annotate src/conversation.c @ 401:7c74e2f579b5

[gaim-migrate @ 411] Heh, whoops. you can send messages to offline people now. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 12 Jun 2000 22:02:50 +0000
parents be408b41c172
children a330017b3aa4
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 "gaim.h"
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 #include "gtkhtml.h"
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include <gdk/gdkkeysyms.h>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37 #include "pixmaps/underline.xpm"
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
38 #include "pixmaps/bold.xpm"
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
39 #include "pixmaps/italic.xpm"
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40 #include "pixmaps/small.xpm"
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 #include "pixmaps/normal.xpm"
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42 #include "pixmaps/big.xpm"
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
43 #include "pixmaps/fontface.xpm"
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44 #include "pixmaps/speaker.xpm"
210
ec0686b3b03f [gaim-migrate @ 220]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 209
diff changeset
45 /* #include "pixmaps/aimicon2.xpm" */
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
46 #include "pixmaps/wood.xpm"
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
47 #include "pixmaps/palette.xpm"
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
48 #include "pixmaps/link.xpm"
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
49 #include "pixmaps/strike.xpm"
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
50
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
51 #include "pixmaps/smile_happy.xpm"
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
52 #include "pixmaps/smile_sad.xpm"
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
53 #include "pixmaps/smile_wink.xpm"
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
54
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
55 int state_lock=0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
56
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
57 GdkPixmap *dark_icon_pm = NULL;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
58 GdkBitmap *dark_icon_bm = NULL;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
59
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
60 char *fontface;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
61
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
62 void check_everything(GtkWidget *entry);
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
63 char *get_tag_by_prefix(GtkWidget *entry, const char *prefix);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
64 gboolean user_keypress_callback(GtkWidget *entry, GdkEventKey *event, struct conversation *c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
65
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
66 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
67 /* Helpers */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
68 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
69
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
70
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
71 void quiet_set(GtkWidget *tb, int state)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
72 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
73 state_lock=1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
74 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(tb), state);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
75 state_lock=0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
76 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
77
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
78
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
79 void set_state_lock(int i)
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 state_lock = i;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
82 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
83
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
84 void toggle_sensitive(GtkWidget *widget, GtkWidget *to_toggle)
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
85 {
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
86 gboolean sensitivity = GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(to_toggle));
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
87
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
88 if (sensitivity == TRUE)
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
89 gtk_widget_set_sensitive(GTK_WIDGET(to_toggle), FALSE);
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
90 else
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
91 gtk_widget_set_sensitive(GTK_WIDGET(to_toggle), TRUE);
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
92
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
93 return;
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
94 }
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
95
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
96 struct conversation *new_conversation(char *name)
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 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
99
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
100 c = find_conversation(name);
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 if (c != NULL)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
103 return c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
104
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
105 c = (struct conversation *)g_new0(struct conversation, 1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
106 g_snprintf(c->name, sizeof(c->name), "%s", name);
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 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
109 FILE *fd;
70
dead1eb6d654 [gaim-migrate @ 80]
Rob Flynn <gaim@robflynn.com>
parents: 68
diff changeset
110
373
1d29321843b0 [gaim-migrate @ 383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 363
diff changeset
111 fd = open_log_file(c->name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
112 if (!(general_options & OPT_GEN_STRIP_HTML))
70
dead1eb6d654 [gaim-migrate @ 80]
Rob Flynn <gaim@robflynn.com>
parents: 68
diff changeset
113 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
114 else
70
dead1eb6d654 [gaim-migrate @ 80]
Rob Flynn <gaim@robflynn.com>
parents: 68
diff changeset
115 fprintf(fd, " ---- New Conversation @ %s ----\n", full_date());
dead1eb6d654 [gaim-migrate @ 80]
Rob Flynn <gaim@robflynn.com>
parents: 68
diff changeset
116
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
117 fclose(fd);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
118 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
119
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
120 show_conv(c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
121 conversations = g_list_append(conversations, c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
122 return c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
123 }
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
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
126 struct conversation *find_conversation(char *name)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
127 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
128 char *cuser = g_malloc(64);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
129 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
130 GList *cnv = conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
131
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
132 strcpy(cuser, normalize(name));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
133
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
134 while(cnv) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
135 c = (struct conversation *)cnv->data;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
136 if(!strcasecmp(cuser, normalize(c->name))) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
137 g_free(cuser);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
138 return c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
139 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
140 cnv = cnv->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
141 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
142 g_free(cuser);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
143 return NULL;
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
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
146 /* given the first part of a tag, returns the length up to the final '>';
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
147 useful for 'remove_tags' calls on variable data, such as <font face>
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
148 tags */
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
149 char *get_tag_by_prefix(GtkWidget *entry, const char *prefix)
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
150 {
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
151 char *s, *t;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
152 int i = 0;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
153
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
154 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
155 t = s;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
156
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
157 if (t = strstr(s, prefix))
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
158 {
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
159 for (i = 1; t[i] != '\0'; i++)
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
160 {
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
161
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
162 if (t[i] == '>')
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
163 break;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
164 }
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
165
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
166 t = gtk_editable_get_chars(GTK_EDITABLE(entry), (t-s), (t-s) + i + 1);
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
167 }
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
168 return t;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
169 }
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
170
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
171 /* ---------------------------------------------------
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
172 * Function to remove a log file entry
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
173 * ---------------------------------------------------
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
174 */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
175
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
176 void rm_log(struct log_conversation *a)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
177 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
178 struct conversation *cnv = find_conversation(a->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
179 char buf[128];
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
180
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
181 log_conversations = g_list_remove(log_conversations, a);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
182
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
183 save_prefs();
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
184
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
185 if (cnv) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
186 if (!(general_options & OPT_GEN_LOG_ALL))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
187 g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, cnv->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
188 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
189 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, cnv->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
190 gtk_window_set_title(GTK_WINDOW(cnv->window), buf);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
191 }
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
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
194 struct log_conversation *find_log_info(char *name)
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 char *pname = g_malloc(64);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
197 GList *lc = log_conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
198 struct log_conversation *l;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
199
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
200
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
201 strcpy(pname, normalize(name));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
202
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
203 while(lc) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
204 l = (struct log_conversation *)lc->data;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
205 if (!strcasecmp(pname, normalize(l->name))) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
206 g_free(pname);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
207 return l;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
208 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
209 lc = lc->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
210 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
211 g_free(pname);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
212 return NULL;
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 void delete_conversation(struct conversation *cnv)
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 conversations = g_list_remove(conversations, cnv);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
218 if (cnv->color_dialog)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
219 gtk_widget_destroy(cnv->color_dialog);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
220 if (cnv->font_dialog)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
221 gtk_widget_destroy(cnv->font_dialog);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
222 g_free(cnv);
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
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
225 void update_log_convs()
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
226 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
227 GList *cnv = conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
228 struct conversation *c;
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 while(cnv) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
231 c = (struct conversation *)cnv->data;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
232
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
233 if (c->log_button)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
234 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
235
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
236 cnv = cnv->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
237 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
238 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
239
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
240 void update_font_buttons()
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
241 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
242 GList *cnv = conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
243 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
244
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
245 while (cnv) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
246 c = (struct conversation *)cnv->data;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
247
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
248 if (c->bold)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
249 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
250
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
251 if (c->italic)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
252 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
253
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
254 if (c->underline)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
255 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
256
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
257 if (c->strike)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
258 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
259
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
260 /* if (c->font)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
261 gtk_widget_set_sensitive(c->font, ((font_options & OPT_FONT_FACE)) ? TRUE : FALSE);*/
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
262
66
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 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
265 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
266
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
267 /*
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
268 void update_transparency()
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
269 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
270 GList *cnv = conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
271 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
272
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
273 This func should be uncalled!
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
274
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
275 while(cnv) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
276 c = (struct conversation *)cnv->data;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
277
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
278 if (c->text)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
279 gtk_html_set_transparent(GTK_HTML(c->text),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
280 (transparent) ? TRUE : FALSE);
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 cnv = cnv->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
283 }
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 */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
286
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 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
289 /* Callbacks */
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
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
292 void toggle_loggle(GtkWidget *w, struct conversation *p)
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 (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
295 return;
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 if (find_log_info(p->name))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
298 rm_log(find_log_info(p->name));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
299 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
300 show_log_dialog(p->name);
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
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
303 static int close_callback(GtkWidget *widget, struct conversation *c)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
304 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
305 gtk_widget_destroy(c->window);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
306 delete_conversation(c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
307 return TRUE;
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
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
310 void set_font_face(GtkWidget *widget, struct conversation *c)
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
311 {
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
312 char *pre_fontface, *old_font_face;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
313 int alloc = 0, length;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
314
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
315 if (!(font_options & OPT_FONT_FACE))
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
316 return;
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
317
308
e5fa88351dc8 [gaim-migrate @ 318]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
318 if (c->current_fontface[0] && strcmp(c->current_fontface, "(null)"))
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
319 {
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
320 pre_fontface = g_strconcat("<FONT FACE=\"", c->current_fontface, "\">", '\0');
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
321 alloc++;
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
322 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
323 else
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
324 pre_fontface = "<FONT FACE=\"Helvetica\">";
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
325
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
326 if (!strcmp(pre_fontface, "<FONT FACE=\"\">"))
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
327 {
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
328 g_free(pre_fontface);
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
329 alloc--;
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
330 pre_fontface = "<FONT FACE=\"Helvetica\">";
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
331 }
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
332
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
333 if (old_font_face = get_tag_by_prefix(c->entry, "<FONT FACE"))
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
334 {
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
335 remove_tags(c->entry, old_font_face);
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
336 remove_tags(c->entry, "</FONT>");
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
337 }
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
338
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
339 surround(c->entry, pre_fontface, "</FONT>");
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
340 gtk_widget_grab_focus(c->entry);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
341
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
342 if (alloc)
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
343 g_free(pre_fontface);
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
344
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
345 g_free(old_font_face); /* mem allocated in get_tag_by_prefix() */
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
346 return;
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
347 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
348
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
349 static gint delete_event_convo(GtkWidget *w, GdkEventAny *e, struct conversation *c)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
350 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
351 delete_conversation(c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
352 return FALSE;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
353 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
354
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
355 static void color_callback(GtkWidget *widget, struct conversation *c)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
356 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
357 /* show_color_dialog(c); */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
358 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
359 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
360
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
361 static void add_callback(GtkWidget *widget, struct conversation *c)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
362 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
363 if (find_buddy(c->name) != NULL) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
364 sprintf(debug_buff,_("Removing '%s' from buddylist.\n"), c->name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
365 debug_print(debug_buff);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
366 remove_buddy(find_group_by_buddy(c->name), find_buddy(c->name));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
367 build_edit_tree();
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
368 gtk_label_set_text(GTK_LABEL(GTK_BIN(c->add_button)->child), _("Add"));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
369 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
370 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
371 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
372 show_add_buddy(c->name, NULL);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
373 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
374
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
375 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
376 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
377
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
378
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
379 static void block_callback(GtkWidget *widget, struct conversation *c)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
380 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
381 show_add_perm(c->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
382 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
383 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
384
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
385 static void warn_callback(GtkWidget *widget, struct conversation *c)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
386 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
387 show_warn_dialog(c->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
388 gtk_widget_grab_focus(c->entry);
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
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
391 static void info_callback(GtkWidget *widget, struct conversation *c)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
392 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
393 serv_get_info(c->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
394 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
395 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
396
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
397 gboolean user_keypress_callback(GtkWidget *entry, GdkEventKey *event, struct conversation *c)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
398 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
399 int pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
400 if(event->keyval==GDK_Return) {
363
1c4ce1da3946 [gaim-migrate @ 373]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
401 if(!(event->state & GDK_SHIFT_MASK)
1c4ce1da3946 [gaim-migrate @ 373]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
402 && (general_options & OPT_GEN_ENTER_SENDS)) {
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
403 gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
404 //to stop the putting in of the enter character
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
405 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
406 } else {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
407 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
408 pos=gtk_editable_get_position(GTK_EDITABLE(entry));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
409 gtk_editable_insert_text(GTK_EDITABLE(entry), "\n", 1, &pos);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
410 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
411 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
412
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
413 return TRUE;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
414
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
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
417
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
418 static void send_callback(GtkWidget *widget, struct conversation *c)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
419 {
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
420 char *buf = g_malloc(BUF_LEN * 4);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
421 char *buf2;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
422 gchar *buf4;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
423 int hdrlen;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
424
283
0f14e6d8a51b [gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 275
diff changeset
425 /* FIXME : for USE_OSCAR, libfaim can send messages much longer
0f14e6d8a51b [gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 275
diff changeset
426 * than this (I think it's about 7K rather than 4K. So we need
0f14e6d8a51b [gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 275
diff changeset
427 * to do these checks a little bit differently here */
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
428 buf4 = gtk_editable_get_chars(GTK_EDITABLE(c->entry), 0, -1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
429 g_snprintf(buf, BUF_LONG, "%s", buf4);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
430 g_free(buf4);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
431
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
432 if (!strlen(buf)) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
433 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
434 }
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 if (general_options & OPT_GEN_SEND_LINKS) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
437 linkify_text(buf);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
438 }
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 /* Let us determine how long the message CAN be.
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
441 * toc_send_im is 11 chars long + 2 quotes.
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
442 * + 2 spaces + 6 for the header + 2 for good
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
443 * measure = 23 bytes + the length of normalize c->name */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
444
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
445 buf2 = g_malloc(BUF_LONG);
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 hdrlen = 23 + strlen(normalize(c->name));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
448
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
449 /* printf("%d %d %d\n", strlen(buf), hdrlen, BUF_LONG);*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
450
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
451 if (font_options & OPT_FONT_BOLD) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
452 g_snprintf(buf2, BUF_LONG, "<B>%s</B>", buf);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
453 strcpy(buf, buf2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
454 }
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 if (font_options & OPT_FONT_ITALIC) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
457 g_snprintf(buf2, BUF_LONG, "<I>%s</I>", buf);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
458 strcpy(buf, buf2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
459 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
460
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
461 if (font_options & OPT_FONT_UNDERLINE) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
462 g_snprintf(buf2, BUF_LONG, "<U>%s</U>", buf);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
463 strcpy(buf, buf2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
464 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
465
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
466 if (font_options & OPT_FONT_STRIKE) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
467 g_snprintf(buf2, BUF_LONG, "<STRIKE>%s</STRIKE>", buf);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
468 strcpy(buf, buf2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
469 }
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
470
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
471 #ifdef GAIM_PLUGINS
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
472 {
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
473 GList *ca = callbacks;
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
474 struct gaim_callback *g;
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
475 void (*function)(char *, char **, void *);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 389
diff changeset
476 char *buffy = g_strdup(buf);
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
477 while (ca) {
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
478 g = (struct gaim_callback *)(ca->data);
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
479 if (g->event == event_im_send && g->function != NULL) {
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
480 function = g->function;
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 389
diff changeset
481 (*function)(c->name, &buffy, g->data);
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
482 }
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
483 ca = ca->next;
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
484 }
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 389
diff changeset
485 if (!buffy) {
102
8c301530b2a3 [gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 101
diff changeset
486 g_free(buf2);
8c301530b2a3 [gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 101
diff changeset
487 return;
8c301530b2a3 [gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 101
diff changeset
488 }
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 389
diff changeset
489 g_snprintf(buf, BUF_LONG, "%s", buffy);
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 389
diff changeset
490 g_free(buffy);
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
491 }
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
492 #endif
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
493
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
494 write_to_conv(c, buf, WFLAG_SEND);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
495
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
496 gtk_editable_delete_text(GTK_EDITABLE(c->entry), 0, -1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
497
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
498 escape_text(buf);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
499 if (escape_message(buf) > MSG_LEN - hdrlen) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
500 do_error_dialog(_("Message too long, some data truncated."), _("Error"));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
501 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
502
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
503 serv_send_im(c->name, buf, 0);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
504
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
505 quiet_set(c->bold, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
506 quiet_set(c->strike, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
507 quiet_set(c->italic, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
508 quiet_set(c->underline, FALSE);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
509 quiet_set(c->font, FALSE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
510 quiet_set(c->palette, FALSE);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
511 quiet_set(c->link, FALSE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
512
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
513 if (c->makesound && (sound_options & OPT_SOUND_SEND))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
514 play_sound(SEND);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
515
375
1eae69f076d2 [gaim-migrate @ 385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 373
diff changeset
516 if ((general_options & OPT_GEN_BACK_ON_IM) && awaymessage != NULL) {
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
517 do_im_back();
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
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
520 set_font_face(NULL, c);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
521
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
522 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
523
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
524 g_free(buf2);
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
525 g_free(buf);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
526 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
527
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
528 static int
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
529 entry_key_pressed(GtkWidget *w, GtkWidget *entry)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
530 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
531 check_everything(w);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
532 return TRUE;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
533 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
534
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
535 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
536 /* HTML-type stuff */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
537 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
538
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
539 int count_tag(GtkWidget *entry, char *s1, char *s2)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
540 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
541 char *p1, *p2;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
542 int res=0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
543 char *tmp, *tmpo, h;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
544 tmpo = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
545 h = tmpo[GTK_EDITABLE(entry)->current_pos];
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
546 tmpo[GTK_EDITABLE(entry)->current_pos]='\0';
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
547 tmp=tmpo;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
548 do {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
549 p1 = strstr(tmp, s1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
550 p2 = strstr(tmp, s2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
551 if (p1 && p2) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
552 if (p1 < p2) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
553 res=1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
554 tmp = p1 +strlen(s1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
555 } else if (p2 < p1) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
556 res = 0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
557 tmp = p2 + strlen(s2);
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 } else {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
560 if (p1) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
561 res = 1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
562 tmp = p1 + strlen(s1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
563 } else if (p2) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
564 res = 0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
565 tmp = p2 + strlen(s2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
566 }
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 } while (p1 || p2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
569 tmpo[GTK_EDITABLE(entry)->current_pos]=h;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
570 g_free(tmpo);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
571 return res;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
572 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
573
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
574
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
575 int invert_tags(GtkWidget *entry, char *s1, char *s2, int really)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
576 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
577 int start = GTK_EDITABLE(entry)->selection_start_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
578 int finish = GTK_EDITABLE(entry)->selection_end_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
579 char *s;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
580
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
581 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
582 if (!strncasecmp(&s[start], s1, strlen(s1)) &&
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
583 !strncasecmp(&s[finish - strlen(s2)], s2, strlen(s2))) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
584 if (really) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
585 gtk_editable_delete_text(GTK_EDITABLE(entry), start, start + strlen(s1));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
586 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
587 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
588 g_free(s);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
589 return 1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
590 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
591 g_free(s);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
592 return 0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
593 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
594
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
595
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
596 void remove_tags(GtkWidget *entry, char *tag)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
597 {
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
598 char *s, *t;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
599 int start = GTK_EDITABLE(entry)->selection_start_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
600 int finish = GTK_EDITABLE(entry)->selection_end_pos;
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
601 int temp;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
602 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
603 t = s;
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
604
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
605 if (start > finish)
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
606 {
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
607 temp = start;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
608 start = finish;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
609 finish = temp;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
610 }
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
611
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
612 if (strstr(tag, "<FONT SIZE="))
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
613 {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
614 while((t = strstr(t, "<FONT SIZE="))) {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
615 if (((t-s) < finish) && ((t-s) >= start)) {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
616 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
617 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
618 t = s;
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
619 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
620 else t++;
68
03ec647d24e9 [gaim-migrate @ 78]
Rob Flynn <gaim@robflynn.com>
parents: 67
diff changeset
621 }
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
622 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
623 else
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
624 {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
625 while((t = strstr(t, tag))) {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
626 if (((t-s) < finish) && ((t-s) >= start)) {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
627 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
628 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
629 t = s;
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
630 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
631 else t++;
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
632 }
66
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 g_free(s);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
635 }
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 void surround(GtkWidget *entry, char *pre, char *post)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
638 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
639 int pos = GTK_EDITABLE(entry)->current_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
640 int dummy;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
641 int start, finish;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
642 if (GTK_EDITABLE(entry)->has_selection) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
643 remove_tags(entry, pre);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
644 remove_tags(entry, post);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
645 start = GTK_EDITABLE(entry)->selection_start_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
646 finish = GTK_EDITABLE(entry)->selection_end_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
647 if (start > finish) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
648 dummy = finish;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
649 finish = start;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
650 start = dummy;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
651 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
652 dummy = start;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
653 gtk_editable_insert_text(GTK_EDITABLE(entry), pre, strlen(pre), &dummy);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
654 dummy = finish + strlen(pre);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
655 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
656 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
657 } else {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
658 gtk_editable_insert_text(GTK_EDITABLE(entry), pre, strlen(pre), &pos);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
659 dummy = pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
660 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
661 gtk_editable_set_position(GTK_EDITABLE(entry), pos);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
662 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
663 gtk_widget_grab_focus(entry);
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
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
666 void advance_past(GtkWidget *entry, char *pre, char *post)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
667 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
668 char *s, *s2;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
669 int pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
670 if (invert_tags(entry, pre, post, 1))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
671 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
672 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
673 pos = GTK_EDITABLE(entry)->current_pos;
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
674 sprintf(debug_buff,_("Currently at %d\n"),pos);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
675 debug_print(debug_buff);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
676 s2= strstr(&s[pos], post);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
677 if (s2)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
678 pos = s2 - s + strlen(post);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
679 else
187
f5c3e340c5e4 [gaim-migrate @ 197]
Rob Flynn <gaim@robflynn.com>
parents: 183
diff changeset
680 pos=strlen(s);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
681 sprintf(debug_buff,_("Setting position to %d\n"),pos);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
682 debug_print(debug_buff);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
683 gtk_editable_set_position(GTK_EDITABLE(entry), pos);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
684 gtk_widget_grab_focus(entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
685 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
686
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
687 static void toggle_color(GtkWidget *color, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
688 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
689 if (state_lock)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
690 return;
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
691 if (GTK_TOGGLE_BUTTON(color)->active)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
692 show_color_dialog(c, color);
189
50dc3db25513 [gaim-migrate @ 199]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 187
diff changeset
693 else
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
694 advance_past(c->entry, "<FONT COLOR>", "</FONT>" );
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
695 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
696
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
697 static void toggle_font(GtkWidget *font, struct conversation *c)
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
698 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
699 if (state_lock)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
700 return;
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
701 if (GTK_TOGGLE_BUTTON(font)->active)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
702 show_font_dialog(c, font);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
703 else
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
704 advance_past(c->entry, "<FONT FACE>", "</FONT>");
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
705
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
706 return;
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
707 }
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
708
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
709 void do_link(GtkWidget *linky, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
710 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
711 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
712 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
713 if (GTK_TOGGLE_BUTTON(linky)->active)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
714 show_add_link(entry, linky);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
715 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
716 advance_past(entry, "<A HREF>", "</A>" );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
717 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
718
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
719 void do_strike(GtkWidget *strike, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
720 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
721 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
722 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
723 if (GTK_TOGGLE_BUTTON(strike)->active)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
724 surround(entry, "<STRIKE>","</STRIKE>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
725 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
726 advance_past(entry, "<STRIKE>", "</STRIKE>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
727 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
728
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
729 void do_bold(GtkWidget *bold, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
730 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
731 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
732 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
733 if (GTK_TOGGLE_BUTTON(bold)->active)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
734 surround(entry, "<B>","</B>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
735 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
736 advance_past(entry, "<B>", "</B>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
737 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
738
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
739 void do_underline(GtkWidget *underline, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
740 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
741 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
742 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
743 if (GTK_TOGGLE_BUTTON(underline)->active)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
744 surround(entry, "<U>","</U>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
745 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
746 advance_past(entry, "<U>", "</U>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
747 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
748
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
749 void do_italic(GtkWidget *italic, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
750 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
751 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
752 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
753 if (GTK_TOGGLE_BUTTON(italic)->active)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
754 surround(entry, "<I>","</I>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
755 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
756 advance_past(entry, "<I>", "</I>");
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
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
759 /* 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
760 /* currently set to 15 chars */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
761
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
762 void do_small(GtkWidget *small, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
763 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
764 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
765 return;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
766 surround(entry, "<FONT SIZE=\"1\">","</FONT>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
767 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
768
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
769 void do_normal(GtkWidget *normal, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
770 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
771 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
772 return;
88
78166fb457f1 [gaim-migrate @ 98]
Rob Flynn <gaim@robflynn.com>
parents: 81
diff changeset
773 surround(entry, "<FONT SIZE=\"3\">","</FONT>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
774 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
775
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
776 void do_big(GtkWidget *big, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
777 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
778 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
779 return;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
780 surround(entry, "<FONT SIZE=\"5\">","</FONT>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
781 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
782
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
783 void check_everything(GtkWidget *entry)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
784 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
785 struct conversation *c;
206
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
786
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
787 c = (struct conversation *)gtk_object_get_user_data(GTK_OBJECT(entry));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
788 if (!c) return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
789 if (invert_tags(entry, "<B>", "</B>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
790 quiet_set(c->bold, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
791 else if (count_tag(entry, "<B>", "</B>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
792 quiet_set(c->bold, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
793 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
794 quiet_set(c->bold,FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
795 if (invert_tags(entry, "<I>", "</I>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
796 quiet_set(c->italic, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
797 else if (count_tag(entry, "<I>", "</I>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
798 quiet_set(c->italic, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
799 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
800 quiet_set(c->italic, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
801
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
802 if (invert_tags(entry, "<FONT COLOR", "</FONT>", 0))
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
803 quiet_set(c->palette, TRUE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
804 else if (count_tag(entry, "<FONT COLOR", "</FONT>"))
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
805 quiet_set(c->palette, TRUE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
806 else
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
807 quiet_set(c->palette, FALSE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
808
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
809 if (invert_tags(entry, "<FONT FACE", "</FONT>", 0))
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
810 quiet_set(c->font, TRUE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
811 else if (count_tag(entry, "<FONT FACE", "</FONT>"))
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
812 quiet_set(c->font, TRUE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
813 else
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
814 quiet_set(c->font, FALSE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
815
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
816 if (invert_tags(entry, "<A HREF", "</A>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
817 quiet_set(c->link, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
818 else if (count_tag(entry, "<A HREF", "</A>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
819 quiet_set(c->link, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
820 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
821 quiet_set(c->link, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
822
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
823 if (invert_tags(entry, "<U>", "</U>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
824 quiet_set(c->underline, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
825 else if (count_tag(entry, "<U>", "</U>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
826 quiet_set(c->underline, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
827 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
828 quiet_set(c->underline, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
829
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
830 if (invert_tags(entry, "<STRIKE>", "</STRIKE>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
831 quiet_set(c->strike, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
832 else if (count_tag(entry, "<STRIKE>", "</STRIKE>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
833 quiet_set(c->strike, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
834 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
835 quiet_set(c->strike, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
836 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
837
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
838
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
839 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
840 /* Takin care of the window.. */
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
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
843
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
844 void write_to_conv(struct conversation *c, char *what, int flags)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
845 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
846 char *buf = g_malloc(BUF_LONG);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
847 char *buf2 = g_malloc(BUF_LONG);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
848 char *who = NULL;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
849 FILE *fd;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
850 char colour[10];
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
851 GdkBitmap *mask;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
852 GdkPixmap *face;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
853 int state;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
854 int y;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
855 int i;
389
5e16d37b48bf [gaim-migrate @ 399]
Rob Flynn <gaim@robflynn.com>
parents: 375
diff changeset
856 char *smiley = g_malloc(7);
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
857
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
858 if (flags & WFLAG_SYSTEM) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
859
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
860 gtk_html_freeze(GTK_HTML(c->text));
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 gtk_html_append_text(GTK_HTML(c->text), what, 0);
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
863
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
864 gtk_html_append_text(GTK_HTML(c->text), "<BR>", 0);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
865
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
866 gtk_html_thaw(GTK_HTML(c->text));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
867
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
868 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
869 char *t1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
870
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
871 if (general_options & OPT_GEN_STRIP_HTML) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
872 t1 = strip_html(what);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
873 } else {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
874 t1 = what;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
875 }
373
1d29321843b0 [gaim-migrate @ 383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 363
diff changeset
876 fd = open_log_file(c->name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
877 fprintf(fd, "%s\n", t1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
878 fclose(fd);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
879 if (general_options & OPT_GEN_STRIP_HTML) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
880 g_free(t1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
881 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
882 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
883
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
884 } else {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
885
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
886 if (flags & WFLAG_RECV) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
887 strcpy(colour, "#ff0000");
145
41bd1cd48571 [gaim-migrate @ 155]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 128
diff changeset
888 who = c->name;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
889 } else if (flags & WFLAG_SEND) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
890 strcpy(colour, "#0000ff");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
891 who = current_user->username;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
892 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
893
145
41bd1cd48571 [gaim-migrate @ 155]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 128
diff changeset
894 if (flags & WFLAG_AUTO)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
895 sprintf(buf2, " %s", AUTO_RESPONSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
896 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
897 buf2[0]=0; /* sprintf(buf2, ""); */
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 (display_options & OPT_DISP_SHOW_TIME)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
900 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><B>%s %s:%s</B></FONT> ", colour, date(), who, buf2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
901 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
902 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><B>%s:%s</B></FONT> ", colour, who, buf2);
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 gtk_html_freeze(GTK_HTML(c->text));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
905
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
906 y = 0;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
907 state = 0;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
908 buf2[0] = 0;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
909
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
910
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
911 gtk_html_append_text(GTK_HTML(c->text), buf, 0);
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
912
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
913 if (display_options & OPT_DISP_SHOW_SMILEY)
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
914 {
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
915 for (i = 0; i < strlen(what); i++)
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
916 {
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
917 buf2[y] = what[i];
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
918 y++;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
919
389
5e16d37b48bf [gaim-migrate @ 399]
Rob Flynn <gaim@robflynn.com>
parents: 375
diff changeset
920 if ( (what[i] == ':') || (what[i] == ';') || (what[i] == 'O') )
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
921 {
389
5e16d37b48bf [gaim-migrate @ 399]
Rob Flynn <gaim@robflynn.com>
parents: 375
diff changeset
922 if (state < 2)
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
923 {
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
924 smiley[state] = what[i];
389
5e16d37b48bf [gaim-migrate @ 399]
Rob Flynn <gaim@robflynn.com>
parents: 375
diff changeset
925 state++;
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
926 }
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
927 else
389
5e16d37b48bf [gaim-migrate @ 399]
Rob Flynn <gaim@robflynn.com>
parents: 375
diff changeset
928 {
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
929 state = 0;
389
5e16d37b48bf [gaim-migrate @ 399]
Rob Flynn <gaim@robflynn.com>
parents: 375
diff changeset
930 }
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
931 }
389
5e16d37b48bf [gaim-migrate @ 399]
Rob Flynn <gaim@robflynn.com>
parents: 375
diff changeset
932 else if ( (what[i] == '-') || (what[i] == '^') || (what[i] == 'o') )
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
933 {
389
5e16d37b48bf [gaim-migrate @ 399]
Rob Flynn <gaim@robflynn.com>
parents: 375
diff changeset
934 if ((state == 1) || (state==2))
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
935 {
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
936 smiley[state] = what[i];
389
5e16d37b48bf [gaim-migrate @ 399]
Rob Flynn <gaim@robflynn.com>
parents: 375
diff changeset
937 state++;
5e16d37b48bf [gaim-migrate @ 399]
Rob Flynn <gaim@robflynn.com>
parents: 375
diff changeset
938 }
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
939 else
389
5e16d37b48bf [gaim-migrate @ 399]
Rob Flynn <gaim@robflynn.com>
parents: 375
diff changeset
940 {
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
941 state = 0;
389
5e16d37b48bf [gaim-migrate @ 399]
Rob Flynn <gaim@robflynn.com>
parents: 375
diff changeset
942 }
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
943 }
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
944 else if ((what[i] == ')') || (what[i] == '*') || (what[i] == '(') ||
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
945 (what[i] == 'p') || (what[i] == 'P') || (what[i] == '$') ||
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
946 (what[i] == '!') || (what[i] == 'D') || (what[i] == 'X') )
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
947 {
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
948 if ( (state == 1) && (what[i] == ')') )
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
949 {
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
950 smiley[state] = what[i];
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
951 smiley[state+1] = 0;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
952 buf2[y - state - 1] = 0;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
953 y = 0;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
954 face = gdk_pixmap_create_from_xpm_d(c->window->window, &mask, &c->window->style->white, smile_happy_xpm);
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
955 gtk_html_append_text(GTK_HTML(c->text), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0);
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
956 gtk_html_add_pixmap(GTK_HTML(c->text), face, 0);
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
957 state = 0;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
958 }
389
5e16d37b48bf [gaim-migrate @ 399]
Rob Flynn <gaim@robflynn.com>
parents: 375
diff changeset
959 else if ( (state == 2) || (state == 3))
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
960 {
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
961 smiley[state] = what[i];
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
962 smiley[state+1] = 0;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
963 buf2[y - state - 1] = 0;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
964 y = 0;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
965
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
966 if (!strcasecmp(smiley, ":-("))
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
967 {
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
968 face = gdk_pixmap_create_from_xpm_d(c->window->window, &mask, &c->window->style->white, smile_sad_xpm);
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
969 }
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
970 else if (!strcasecmp(smiley, ";-)"))
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
971 {
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
972 face = gdk_pixmap_create_from_xpm_d(c->window->window, &mask, &c->window->style->white, smile_wink_xpm);
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
973 }
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
974 else
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
975 {
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
976 face = gdk_pixmap_create_from_xpm_d(c->window->window, &mask, &c->window->style->white, smile_happy_xpm);
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
977 }
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
978
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
979 gtk_html_append_text(GTK_HTML(c->text), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0);
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
980 gtk_html_add_pixmap(GTK_HTML(c->text), face, 0);
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
981 state = 0;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
982 }
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
983 else
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
984 state = 0;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
985 }
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
986 else
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
987 {
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
988 state = 0;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
989 }
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
990 }
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
991
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
992 if (buf2)
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
993 {
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
994 buf2[y] = 0;
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
995 gtk_html_append_text(GTK_HTML(c->text), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0);
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
996 }
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
997 }
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
998 else
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
999 {
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1000 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
1001 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1002
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1003 gtk_html_append_text(GTK_HTML(c->text), "<BR>", 0);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1004
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1005
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1006 gtk_html_thaw(GTK_HTML(c->text));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1007
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1008 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1009 char *t1, *t2;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1010
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1011 if (general_options & OPT_GEN_STRIP_HTML) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1012 t1 = strip_html(buf);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1013 t2 = strip_html(what);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1014 } else {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1015 t1 = buf;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1016 t2 = what;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1017 }
373
1d29321843b0 [gaim-migrate @ 383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 363
diff changeset
1018 fd = open_log_file(c->name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1019 fprintf(fd, "%s%s\n", t1, t2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1020 fclose(fd);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1021 if (general_options & OPT_GEN_STRIP_HTML) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1022 g_free(t1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1023 g_free(t2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1024 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1025 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1026 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1027
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1028 /* if (!GTK_WIDGET_MAPPED(c->window)) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1029
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1030 if (dark_icon_pm == NULL)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1031 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
1032 NULL, (gchar **)aimicon2_xpm);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1033 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
1034 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1035 */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1036
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1037 if (general_options & OPT_GEN_POPUP_WINDOWS)
81
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1038 gdk_window_show(c->window->window);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1039
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1040 g_free(smiley);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1041 g_free(buf);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1042 g_free(buf2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1043 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1044
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1045
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1046
206
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
1047 static void check_spelling( GtkEditable * editable, gchar * new_text,
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
1048 gint length, gint * position,
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
1049 gpointer data )
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
1050 {
207
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1051 if (general_options & OPT_GEN_CHECK_SPELLING)
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1052 {
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1053 gtk_signal_handler_block_by_func(GTK_OBJECT(editable),
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1054 GTK_SIGNAL_FUNC(check_spelling), data);
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1055 gtk_text_set_point(GTK_TEXT(editable), *position);
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1056 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
1057 if(isspace(new_text[0]))
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1058 {
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1059 gtk_text_freeze(GTK_TEXT(editable));
209
6e9b375e30e7 [gaim-migrate @ 219]
Rob Flynn <gaim@robflynn.com>
parents: 207
diff changeset
1060 spell_checker(GTK_WIDGET(editable));
207
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1061 gtk_text_thaw(GTK_TEXT(editable));
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1062 }
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1063 gtk_signal_handler_unblock_by_func(GTK_OBJECT(editable),
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1064 GTK_SIGNAL_FUNC(check_spelling), data);
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1065 gtk_signal_emit_stop_by_name(GTK_OBJECT(editable), "insert-text");
249e3fd5be29 [gaim-migrate @ 217]
Rob Flynn <gaim@robflynn.com>
parents: 206
diff changeset
1066 }
206
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
1067 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1068
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1069
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1070 void show_conv(struct conversation *c)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1071 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1072 GtkWidget *win;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1073 char buf[256];
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1074 GtkWidget *text;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1075 GtkWidget *sw;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1076 GtkWidget *send;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1077 GtkWidget *info;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1078 GtkWidget *warn;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1079 GtkWidget *block;
308
e5fa88351dc8 [gaim-migrate @ 318]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
1080 /* GtkWidget *color; */
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1081 GtkWidget *close;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1082 GtkWidget *entry;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1083 GtkWidget *toolbar;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1084 GtkWidget *bbox;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1085 GtkWidget *vbox;
81
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1086 GtkWidget *vbox2;
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1087 GtkWidget *paned;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1088 GtkWidget *add;
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1089 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;
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1090 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;
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1091 GtkWidget *strike, *small, *normal, *big, *bold, *italic, *underline, *speaker, *wood, *palette, *link, *font;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1092 GdkBitmap *mask;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1093
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1094 win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1095 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1096
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1097 gtk_widget_realize(win);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1098 aol_icon(win->window);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1099
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1100
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1101 c->window = win;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1102
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1103 send = gtk_button_new_with_label(_("Send"));
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1104 info = gtk_button_new_with_label(_("Info"));
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1105 warn = gtk_button_new_with_label(_("Warn"));
308
e5fa88351dc8 [gaim-migrate @ 318]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
1106 /* color = gtk_button_new_with_label("Color"); */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1107 close = gtk_button_new_with_label(_("Close"));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1108 if (find_buddy(c->name) != NULL) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1109 add = gtk_button_new_with_label(_("Remove"));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1110 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1111 else {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1112 add = gtk_button_new_with_label(_("Add"));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1113 }
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1114 block = gtk_button_new_with_label(_("Block"));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1115
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1116
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1117 bbox = gtk_hbox_new(TRUE, 0);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1118 vbox = gtk_vbox_new(FALSE, 0);
81
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1119 vbox2 = gtk_vbox_new(FALSE, 0);
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1120 paned = gtk_vpaned_new();
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1121
81
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1122 gtk_paned_pack1(GTK_PANED(paned), vbox, FALSE, TRUE);
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1123 gtk_paned_pack2(GTK_PANED(paned), vbox2, FALSE, FALSE);
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1124 gtk_widget_show(vbox2);
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1125 gtk_widget_show(paned);
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1126
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1127 entry = gtk_text_new(NULL, NULL);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1128 gtk_text_set_editable(GTK_TEXT(entry), TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1129 gtk_text_set_word_wrap(GTK_TEXT(entry), TRUE);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
1130
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1131 /* Toolbar */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1132 toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
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 link_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1135 &win->style->white, link_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1136 link_p = gtk_pixmap_new(link_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1137 gtk_widget_show(link_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1138
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1139 palette_i = gdk_pixmap_create_from_xpm_d (win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1140 &win->style->white, palette_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1141 palette_p = gtk_pixmap_new(palette_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1142 gtk_widget_show(palette_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1143
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1144 wood_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1145 &win->style->white, wood_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1146 wood_p = gtk_pixmap_new(wood_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1147 gtk_widget_show(wood_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1148 speaker_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1149 &win->style->white, speaker_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1150 speaker_p = gtk_pixmap_new(speaker_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1151 gtk_widget_show(speaker_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1152 c->makesound=1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1153 strike_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1154 &win->style->white, strike_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1155 strike_p = gtk_pixmap_new(strike_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1156 gtk_widget_show(strike_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1157 bold_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1158 &win->style->white, bold_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1159 bold_p = gtk_pixmap_new(bold_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1160 gtk_widget_show(bold_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1161 italic_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1162 &win->style->white, italic_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1163 italic_p = gtk_pixmap_new(italic_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1164 gtk_widget_show(italic_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1165 underline_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1166 &win->style->white, underline_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1167 underline_p = gtk_pixmap_new(underline_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1168 gtk_widget_show(underline_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1169 small_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1170 &win->style->white, small_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1171 small_p = gtk_pixmap_new(small_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1172 gtk_widget_show(small_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1173 normal_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1174 &win->style->white, normal_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1175 normal_p = gtk_pixmap_new(normal_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1176 gtk_widget_show(normal_p);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1177 big_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1178 &win->style->white, big_xpm );
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1179 big_p = gtk_pixmap_new(big_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1180 gtk_widget_show(big_p);
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1181 font_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask,
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1182 &win->style->white, fontface_xpm );
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1183 font_p = gtk_pixmap_new(font_i, mask);
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1184 gtk_widget_show(font_p);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1185
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1186 bold = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1187 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1188 _("Bold"), _("Bold Text"), _("Bold"), bold_p,
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1189 GTK_SIGNAL_FUNC(do_bold), entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1190 italic = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1191 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1192 NULL, _("Italics"), _("Italics Text"),
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1193 _("Italics"), italic_p, GTK_SIGNAL_FUNC(do_italic), entry);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1194 underline = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1195 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1196 NULL, _("Underline"), _("Underline Text"),
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1197 _("Underline"), underline_p, GTK_SIGNAL_FUNC(do_underline), entry);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1198 strike = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1199 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1200 NULL, _("Strike"), _("Strike through Text"),
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1201 _("Strike"), strike_p, GTK_SIGNAL_FUNC(do_strike), entry);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1202 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1203 small = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Small"), _("Decrease font size"), _("Small"), small_p, GTK_SIGNAL_FUNC(do_small), entry);
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1204 normal = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Normal"), _("Normal font size"), _("Normal"), normal_p, GTK_SIGNAL_FUNC(do_normal), entry);
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1205 big = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Big"), _("Increase font size"), _("Big"), big_p, GTK_SIGNAL_FUNC(do_big), entry);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1206 font = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1207 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1208 NULL, _("Font"), _("Select Font"),
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1209 _("Font"), font_p, GTK_SIGNAL_FUNC(toggle_font), c);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1210
309
97cdac04c0f5 [gaim-migrate @ 319]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
1211 if (!(font_options & OPT_FONT_FACE))
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1212 gtk_widget_set_sensitive(GTK_WIDGET(font), FALSE);
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1213
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1214 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1215 link = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1216 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, _("Link"), _("Insert Link"),
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1217 _("Link"), link_p, GTK_SIGNAL_FUNC(do_link), entry);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1218 palette = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1219 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1220 NULL, _("Color"), _("Text Color"),
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1221 _("Color"), palette_p, GTK_SIGNAL_FUNC(toggle_color), c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1222 wood = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1223 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1224 NULL, _("Logging"), _("Enable logging"),
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1225 _("Logging"), wood_p, GTK_SIGNAL_FUNC(toggle_loggle), c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1226 speaker = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1227 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1228 NULL, _("Sound"), _("Enable sounds"),
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1229 _("Sound"), speaker_p, GTK_SIGNAL_FUNC(set_option), &c->makesound);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1230 c->makesound=0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1231 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(speaker), TRUE);
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1232
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1233 state_lock = 1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1234 if (find_log_info(c->name))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1235 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1236 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1237 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1238 state_lock = 0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1239
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1240 gtk_widget_show(toolbar);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1241
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1242 c->entry = entry;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1243 c->bold = bold;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1244 c->strike = strike;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1245 c->italic = italic;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1246 c->underline = underline;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1247 c->log_button = wood;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1248 c->palette = palette;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1249 c->link = link;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1250 c->add_button = add;
308
e5fa88351dc8 [gaim-migrate @ 318]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
1251 c->font = font;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1252
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1253 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
1254
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1255 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
1256 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
1257 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
1258 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
1259
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1260 gtk_object_set_user_data(GTK_OBJECT(entry), c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1261
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1262
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1263
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1264 gtk_signal_connect(GTK_OBJECT(entry), "activate", GTK_SIGNAL_FUNC(send_callback),c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1265
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1266 /* Text box */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1267
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1268
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1269 text = gtk_html_new(NULL, NULL);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1270
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1271 gtk_html_set_editable(GTK_HTML(text), FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1272 /* gtk_html_set_transparent(GTK_HTML(text), (transparent) ? TRUE : FALSE);*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1273 c->text = text;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1274
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1275 sw = gtk_scrolled_window_new (NULL, NULL);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1276 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1277 GTK_POLICY_NEVER,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1278 GTK_POLICY_ALWAYS);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1279 gtk_widget_show(sw);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1280 gtk_container_add(GTK_CONTAINER(sw), text);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1281 gtk_widget_show(text);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1282
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1283
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1284
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 GTK_HTML (text)->hadj->step_increment = 10.0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1287 GTK_HTML (text)->vadj->step_increment = 10.0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1288 gtk_widget_set_usize(sw, 320, 150);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1289
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
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1292 /* Ready and pack buttons */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1293 gtk_object_set_user_data(GTK_OBJECT(win), c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1294 gtk_object_set_user_data(GTK_OBJECT(close), c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1295 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
1296 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
1297 gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(add_callback), c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1298 gtk_signal_connect(GTK_OBJECT(info), "clicked", GTK_SIGNAL_FUNC(info_callback), c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1299 gtk_signal_connect(GTK_OBJECT(warn), "clicked", GTK_SIGNAL_FUNC(warn_callback), c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1300 gtk_signal_connect(GTK_OBJECT(block), "clicked", GTK_SIGNAL_FUNC(block_callback), c);
308
e5fa88351dc8 [gaim-migrate @ 318]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
1301 /* gtk_signal_connect(GTK_OBJECT(color), "clicked", GTK_SIGNAL_FUNC(color_callback), c); */
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1302
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1303 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(user_keypress_callback), c);
81
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1304 gtk_widget_set_usize(entry, 300, 25);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1305
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1306 gtk_box_pack_start(GTK_BOX(bbox), send, TRUE, TRUE, 5);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1307 gtk_box_pack_start(GTK_BOX(bbox), info, TRUE, TRUE, 5);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1308 gtk_box_pack_start(GTK_BOX(bbox), warn, TRUE, TRUE, 5);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1309 gtk_box_pack_start(GTK_BOX(bbox), block, TRUE, TRUE, 5);
308
e5fa88351dc8 [gaim-migrate @ 318]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
1310 /* gtk_box_pack_start(GTK_BOX(bbox), color, TRUE, TRUE, 5); */
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1311 gtk_box_pack_start(GTK_BOX(bbox), add, TRUE, TRUE, 5);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1312 gtk_box_pack_start(GTK_BOX(bbox), close, TRUE, TRUE, 5);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1313
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1314 /* pack and fill the rest */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1315
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1316 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 5);
81
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1317 gtk_box_pack_start(GTK_BOX(vbox2), toolbar, FALSE, FALSE, 5);
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1318 gtk_box_pack_start(GTK_BOX(vbox2), entry, TRUE, TRUE, 5);
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1319 gtk_box_pack_start(GTK_BOX(vbox2), bbox, FALSE, FALSE, 5);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1320
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1321 gtk_widget_show(send);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1322 gtk_widget_show(info);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1323 gtk_widget_show(warn);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1324 /* gtk_widget_show(color); */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1325 gtk_widget_show(close);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1326 gtk_widget_show(add);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1327 gtk_widget_show(block);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1328 gtk_widget_show(bbox);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1329 gtk_widget_show(vbox);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1330 gtk_widget_show(entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1331 gtk_widget_show(text);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1332
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1333 c->font_dialog = NULL;
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1334 c->color_dialog = NULL;
67
65a118affac1 [gaim-migrate @ 77]
Rob Flynn <gaim@robflynn.com>
parents: 66
diff changeset
1335
81
7a24bb75a97b [gaim-migrate @ 91]
Rob Flynn <gaim@robflynn.com>
parents: 79
diff changeset
1336 gtk_container_add(GTK_CONTAINER(win), paned);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1337 gtk_container_border_width(GTK_CONTAINER(win), 10);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1338
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1339 if ((find_log_info(c->name)) || ((general_options & OPT_GEN_LOG_ALL)))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1340 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, c->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1341 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1342 g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, c->name);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1343 gtk_window_set_title(GTK_WINDOW(win), buf);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1344 gtk_window_set_focus(GTK_WINDOW(win),entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1345
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1346 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
1347 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
1348 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(entry_key_pressed), entry);
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1349
315
68637b451377 [gaim-migrate @ 325]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
1350 if (fontface)
68637b451377 [gaim-migrate @ 325]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
1351 strncpy(c->current_fontface, fontface, sizeof(c->current_fontface));
68637b451377 [gaim-migrate @ 325]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
1352 if (fontname)
68637b451377 [gaim-migrate @ 325]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
1353 strncpy(c->current_fontname, fontname, sizeof(c->current_fontname));
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1354
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
1355 set_font_face(NULL, c);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
1356
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1357 gtk_widget_show(win);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1358 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1359
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1360