Mercurial > pidgin
annotate pidgin/gtkwebviewtoolbar.c @ 32719:0a184aea3efd
Remove an old debug line.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sun, 26 Feb 2012 06:40:05 +0000 |
parents | 783ac40a7408 |
children | 4547ab591cfc |
rev | line source |
---|---|
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1 /* |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
2 * @file gtkwebviewtoolbar.c GTK+ WebView Toolbar |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
3 * @ingroup pidgin |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
4 */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
5 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
6 /* pidgin |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
7 * |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
8 * Pidgin is the legal property of its developers, whose names are too numerous |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
10 * source distribution. |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
11 * |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
12 * This program is free software; you can redistribute it and/or modify |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
13 * under the terms of the GNU General Public License as published by |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
15 * (at your option) any later version. |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
16 * |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
20 * GNU General Public License for more details. |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
21 * |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
25 * |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
26 */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
27 #include "internal.h" |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
28 #include "pidgin.h" |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
29 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
30 #include "imgstore.h" |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
31 #include "notify.h" |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
32 #include "prefs.h" |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
33 #include "request.h" |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
34 #include "pidginstock.h" |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
35 #include "util.h" |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
36 #include "debug.h" |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
37 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
38 #include "gtkdialogs.h" |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
39 #include "gtkwebviewtoolbar.h" |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
40 #include "gtksmiley.h" |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
41 #include "gtkthemes.h" |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
42 #include "gtkutils.h" |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
43 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
44 #include <gdk/gdkkeysyms.h> |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
45 |
32465
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
46 #if !GTK_CHECK_VERSION(2,18,0) |
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
47 #define gtk_widget_get_visible(x) GTK_WIDGET_VISIBLE((x)) |
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
48 #define gtk_widget_is_sensitive(x) GTK_WIDGET_IS_SENSITIVE((x)) |
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
49 #if !GTK_CHECK_VERSION(2,12,0) |
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
50 #define gtk_widget_set_tooltip_text(w, t) \ |
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
51 gtk_tooltips_set_tip(priv->tooltips, (w), (t), NULL) |
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
52 #endif |
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
53 #endif |
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
54 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
55 #define GTK_WEBVIEWTOOLBAR_GET_PRIVATE(obj) \ |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
56 (G_TYPE_INSTANCE_GET_PRIVATE((obj), GTK_TYPE_WEBVIEWTOOLBAR, GtkWebViewToolbarPriv)) |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
57 |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
58 /****************************************************************************** |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
59 * Structs |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
60 *****************************************************************************/ |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
61 |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
62 typedef struct _GtkWebViewToolbarPriv { |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
63 PurpleConversation *active_conv; |
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
64 |
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
65 GtkWidget *wide_view; |
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
66 GtkWidget *lean_view; |
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
67 |
32465
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
68 #if !GTK_CHECK_VERSION(2,12,0) |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
69 GtkTooltips *tooltips; |
32465
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
70 #endif |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
71 |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
72 GtkWidget *font_label; |
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
73 GtkWidget *font_menu; |
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
74 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
75 GtkWidget *bold; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
76 GtkWidget *italic; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
77 GtkWidget *underline; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
78 GtkWidget *strike; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
79 |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
80 GtkWidget *larger_size; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
81 GtkWidget *normal_size; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
82 GtkWidget *smaller_size; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
83 |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
84 GtkWidget *font; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
85 GtkWidget *fgcolor; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
86 GtkWidget *bgcolor; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
87 |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
88 GtkWidget *clear; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
89 |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
90 GtkWidget *insert_menu; |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
91 GtkWidget *image; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
92 GtkWidget *link; |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
93 GtkWidget *insert_hr; |
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
94 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
95 GtkWidget *smiley; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
96 GtkWidget *attention; |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
97 GtkWidget *call; |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
98 |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
99 GtkWidget *font_dialog; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
100 GtkWidget *fgcolor_dialog; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
101 GtkWidget *bgcolor_dialog; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
102 GtkWidget *link_dialog; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
103 GtkWidget *smiley_dialog; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
104 GtkWidget *image_dialog; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
105 |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
106 char *sml; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
107 } GtkWebViewToolbarPriv; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
108 |
32460
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
109 /****************************************************************************** |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
110 * Globals |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
111 *****************************************************************************/ |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
112 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
113 static GtkHBoxClass *parent_class = NULL; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
114 |
32460
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
115 /****************************************************************************** |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
116 * Prototypes |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
117 *****************************************************************************/ |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
118 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
119 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
120 toggle_button_set_active_block(GtkToggleButton *button, gboolean is_active, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
121 GtkWebViewToolbar *toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
122 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
123 static gboolean |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
124 gtk_webviewtoolbar_popup_menu(GtkWidget *widget, GdkEventButton *event, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
125 GtkWebViewToolbar *toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
126 |
32460
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
127 /****************************************************************************** |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
128 * Helpers |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
129 *****************************************************************************/ |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
130 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
131 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
132 do_bold(GtkWidget *bold, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
133 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
134 g_return_if_fail(toolbar != NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
135 gtk_webview_toggle_bold(GTK_WEBVIEW(toolbar->webview)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
136 gtk_widget_grab_focus(toolbar->webview); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
137 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
138 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
139 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
140 do_italic(GtkWidget *italic, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
141 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
142 g_return_if_fail(toolbar != NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
143 gtk_webview_toggle_italic(GTK_WEBVIEW(toolbar->webview)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
144 gtk_widget_grab_focus(toolbar->webview); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
145 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
146 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
147 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
148 do_underline(GtkWidget *underline, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
149 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
150 g_return_if_fail(toolbar != NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
151 gtk_webview_toggle_underline(GTK_WEBVIEW(toolbar->webview)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
152 gtk_widget_grab_focus(toolbar->webview); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
153 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
154 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
155 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
156 do_strikethrough(GtkWidget *strikethrough, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
157 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
158 g_return_if_fail(toolbar != NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
159 gtk_webview_toggle_strike(GTK_WEBVIEW(toolbar->webview)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
160 gtk_widget_grab_focus(toolbar->webview); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
161 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
162 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
163 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
164 do_small(GtkWidget *smalltb, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
165 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
166 g_return_if_fail(toolbar != NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
167 /* Only shrink the font on activation, not deactivation as well */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
168 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(smalltb))) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
169 gtk_webview_font_shrink(GTK_WEBVIEW(toolbar->webview)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
170 gtk_widget_grab_focus(toolbar->webview); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
171 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
172 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
173 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
174 do_big(GtkWidget *large, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
175 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
176 g_return_if_fail(toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
177 /* Only grow the font on activation, not deactivation as well */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
178 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(large))) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
179 gtk_webview_font_grow(GTK_WEBVIEW(toolbar->webview)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
180 gtk_widget_grab_focus(toolbar->webview); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
181 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
182 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
183 static gboolean |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
184 destroy_toolbar_font(GtkWidget *widget, GdkEvent *event, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
185 GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
186 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
187 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
188 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
189 if (widget != NULL) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
190 gtk_webview_toggle_fontface(GTK_WEBVIEW(toolbar->webview), ""); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
191 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
192 if (priv->font_dialog != NULL) |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
193 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
194 gtk_widget_destroy(priv->font_dialog); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
195 priv->font_dialog = NULL; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
196 } |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
197 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
198 return FALSE; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
199 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
200 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
201 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
202 realize_toolbar_font(GtkWidget *widget, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
203 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
204 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
205 GtkFontSelection *sel; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
206 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
207 sel = GTK_FONT_SELECTION(GTK_FONT_SELECTION_DIALOG(priv->font_dialog)->fontsel); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
208 gtk_widget_hide_all(gtk_widget_get_parent(sel->size_entry)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
209 gtk_widget_show_all(sel->family_list); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
210 gtk_widget_show(gtk_widget_get_parent(sel->family_list)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
211 gtk_widget_show(gtk_widget_get_parent(gtk_widget_get_parent(sel->family_list))); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
212 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
213 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
214 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
215 cancel_toolbar_font(GtkWidget *widget, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
216 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
217 destroy_toolbar_font(widget, NULL, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
218 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
219 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
220 static void |
32463
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
221 apply_font(GtkWidget *widget, GtkWebViewToolbar *toolbar) |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
222 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
223 /* this could be expanded to include font size, weight, etc. |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
224 but for now only works with font face */ |
32463
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
225 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
226 GtkFontSelectionDialog *fontsel = GTK_FONT_SELECTION_DIALOG(priv->font_dialog); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
227 gchar *fontname = gtk_font_selection_dialog_get_font_name(fontsel); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
228 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
229 if (fontname) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
230 const gchar *family_name = NULL; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
231 PangoFontDescription *desc = NULL; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
232 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
233 desc = pango_font_description_from_string(fontname); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
234 family_name = pango_font_description_get_family(desc); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
235 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
236 if (family_name) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
237 gtk_webview_toggle_fontface(GTK_WEBVIEW(toolbar->webview), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
238 family_name); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
239 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
240 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
241 pango_font_description_free(desc); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
242 g_free(fontname); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
243 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
244 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
245 cancel_toolbar_font(NULL, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
246 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
247 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
248 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
249 toggle_font(GtkWidget *font, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
250 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
251 GtkWebViewToolbarPriv *priv; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
252 g_return_if_fail(toolbar); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
253 priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
254 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
255 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(font))) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
256 const char *fontname = gtk_webview_get_current_fontface(GTK_WEBVIEW(toolbar->webview)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
257 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
258 if (!priv->font_dialog) { |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
259 priv->font_dialog = gtk_font_selection_dialog_new(_("Select Font")); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
260 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
261 if (fontname) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
262 char *fonttif = g_strdup_printf("%s 12", fontname); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
263 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(priv->font_dialog), |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
264 fonttif); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
265 g_free(fonttif); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
266 } else { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
267 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(priv->font_dialog), |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
268 DEFAULT_FONT_FACE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
269 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
270 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
271 g_signal_connect(G_OBJECT(priv->font_dialog), "delete_event", |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
272 G_CALLBACK(destroy_toolbar_font), toolbar); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
273 g_signal_connect(G_OBJECT(GTK_FONT_SELECTION_DIALOG(priv->font_dialog)->ok_button), "clicked", |
32463
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
274 G_CALLBACK(apply_font), toolbar); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
275 g_signal_connect(G_OBJECT(GTK_FONT_SELECTION_DIALOG(priv->font_dialog)->cancel_button), "clicked", |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
276 G_CALLBACK(cancel_toolbar_font), toolbar); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
277 g_signal_connect_after(G_OBJECT(priv->font_dialog), "realize", |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
278 G_CALLBACK(realize_toolbar_font), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
279 } |
32463
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
280 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
281 gtk_window_present(GTK_WINDOW(priv->font_dialog)); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
282 } else { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
283 cancel_toolbar_font(font, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
284 } |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
285 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
286 gtk_widget_grab_focus(toolbar->webview); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
287 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
288 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
289 static gboolean |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
290 destroy_toolbar_fgcolor(GtkWidget *widget, GdkEvent *event, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
291 GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
292 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
293 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
294 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
295 if (widget != NULL) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
296 gtk_webview_toggle_forecolor(GTK_WEBVIEW(toolbar->webview), ""); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
297 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
298 if (priv->fgcolor_dialog != NULL) |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
299 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
300 gtk_widget_destroy(priv->fgcolor_dialog); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
301 priv->fgcolor_dialog = NULL; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
302 } |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
303 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
304 return FALSE; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
305 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
306 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
307 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
308 cancel_toolbar_fgcolor(GtkWidget *widget, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
309 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
310 destroy_toolbar_fgcolor(widget, NULL, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
311 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
312 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
313 static void |
32463
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
314 do_fgcolor(GtkWidget *widget, GtkWebViewToolbar *toolbar) |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
315 { |
32463
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
316 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
317 GtkColorSelectionDialog *dialog; |
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
318 GtkColorSelection *colorsel; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
319 GdkColor text_color; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
320 char *open_tag; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
321 |
32463
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
322 dialog = GTK_COLOR_SELECTION_DIALOG(priv->fgcolor_dialog); |
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
323 colorsel = GTK_COLOR_SELECTION(dialog->colorsel); |
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
324 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
325 open_tag = g_malloc(30); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
326 gtk_color_selection_get_current_color(colorsel, &text_color); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
327 g_snprintf(open_tag, 23, "#%02X%02X%02X", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
328 text_color.red / 256, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
329 text_color.green / 256, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
330 text_color.blue / 256); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
331 gtk_webview_toggle_forecolor(GTK_WEBVIEW(toolbar->webview), open_tag); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
332 g_free(open_tag); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
333 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
334 cancel_toolbar_fgcolor(NULL, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
335 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
336 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
337 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
338 toggle_fg_color(GtkWidget *color, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
339 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
340 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
341 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(color))) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
342 GtkWidget *colorsel; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
343 GdkColor fgcolor; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
344 const char *color = gtk_webview_get_current_forecolor(GTK_WEBVIEW(toolbar->webview)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
345 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
346 if (!priv->fgcolor_dialog) { |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
347 priv->fgcolor_dialog = gtk_color_selection_dialog_new(_("Select Text Color")); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
348 colorsel = GTK_COLOR_SELECTION_DIALOG(priv->fgcolor_dialog)->colorsel; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
349 if (color) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
350 gdk_color_parse(color, &fgcolor); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
351 gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(colorsel), &fgcolor); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
352 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
353 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
354 g_signal_connect(G_OBJECT(priv->fgcolor_dialog), "delete_event", |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
355 G_CALLBACK(destroy_toolbar_fgcolor), toolbar); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
356 g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(priv->fgcolor_dialog)->ok_button), "clicked", |
32463
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
357 G_CALLBACK(do_fgcolor), toolbar); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
358 g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(priv->fgcolor_dialog)->cancel_button), "clicked", |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
359 G_CALLBACK(cancel_toolbar_fgcolor), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
360 } |
32463
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
361 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
362 gtk_window_present(GTK_WINDOW(priv->fgcolor_dialog)); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
363 } else { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
364 cancel_toolbar_fgcolor(color, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
365 } |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
366 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
367 gtk_widget_grab_focus(toolbar->webview); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
368 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
369 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
370 static gboolean |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
371 destroy_toolbar_bgcolor(GtkWidget *widget, GdkEvent *event, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
372 GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
373 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
374 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
375 if (widget != NULL) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
376 #if 0 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
377 if (gtk_text_buffer_get_selection_bounds(GTK_WEBVIEW(toolbar->webview)->text_buffer, NULL, NULL)) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
378 gtk_webview_toggle_backcolor(GTK_WEBVIEW(toolbar->webview), ""); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
379 else |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
380 #endif |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
381 gtk_webview_toggle_background(GTK_WEBVIEW(toolbar->webview), ""); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
382 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
383 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
384 if (priv->bgcolor_dialog != NULL) |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
385 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
386 gtk_widget_destroy(priv->bgcolor_dialog); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
387 priv->bgcolor_dialog = NULL; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
388 } |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
389 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
390 return FALSE; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
391 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
392 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
393 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
394 cancel_toolbar_bgcolor(GtkWidget *widget, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
395 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
396 destroy_toolbar_bgcolor(widget, NULL, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
397 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
398 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
399 static void |
32463
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
400 do_bgcolor(GtkWidget *widget, GtkWebViewToolbar *toolbar) |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
401 { |
32463
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
402 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
403 GtkColorSelectionDialog *dialog; |
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
404 GtkColorSelection *colorsel; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
405 GdkColor text_color; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
406 char *open_tag; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
407 |
32463
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
408 dialog = GTK_COLOR_SELECTION_DIALOG(priv->bgcolor_dialog); |
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
409 colorsel = GTK_COLOR_SELECTION(dialog->colorsel); |
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
410 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
411 open_tag = g_malloc(30); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
412 gtk_color_selection_get_current_color(colorsel, &text_color); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
413 g_snprintf(open_tag, 23, "#%02X%02X%02X", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
414 text_color.red / 256, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
415 text_color.green / 256, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
416 text_color.blue / 256); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
417 #if 0 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
418 if (gtk_text_buffer_get_selection_bounds(GTK_WEBVIEW(toolbar->webview)->text_buffer, NULL, NULL)) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
419 gtk_webview_toggle_backcolor(GTK_WEBVIEW(toolbar->webview), open_tag); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
420 else |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
421 #endif |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
422 gtk_webview_toggle_background(GTK_WEBVIEW(toolbar->webview), open_tag); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
423 g_free(open_tag); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
424 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
425 cancel_toolbar_bgcolor(NULL, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
426 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
427 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
428 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
429 toggle_bg_color(GtkWidget *color, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
430 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
431 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
432 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(color))) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
433 GtkWidget *colorsel; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
434 GdkColor bgcolor; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
435 const char *color = gtk_webview_get_current_backcolor(GTK_WEBVIEW(toolbar->webview)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
436 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
437 if (!priv->bgcolor_dialog) { |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
438 priv->bgcolor_dialog = gtk_color_selection_dialog_new(_("Select Background Color")); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
439 colorsel = GTK_COLOR_SELECTION_DIALOG(priv->bgcolor_dialog)->colorsel; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
440 if (color) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
441 gdk_color_parse(color, &bgcolor); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
442 gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(colorsel), &bgcolor); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
443 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
444 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
445 g_signal_connect(G_OBJECT(priv->bgcolor_dialog), "delete_event", |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
446 G_CALLBACK(destroy_toolbar_bgcolor), toolbar); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
447 g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(priv->bgcolor_dialog)->ok_button), "clicked", |
32463
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
448 G_CALLBACK(do_bgcolor), toolbar); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
449 g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(priv->bgcolor_dialog)->cancel_button), "clicked", |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
450 G_CALLBACK(cancel_toolbar_bgcolor), toolbar); |
32463
8a8751c06d65
Use the toolbar as the userdat to avoid g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32462
diff
changeset
|
451 } |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
452 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
453 gtk_window_present(GTK_WINDOW(priv->bgcolor_dialog)); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
454 } else { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
455 cancel_toolbar_bgcolor(color, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
456 } |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
457 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
458 gtk_widget_grab_focus(toolbar->webview); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
459 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
460 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
461 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
462 clear_formatting_cb(GtkWidget *clear, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
463 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
464 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
465 toggle_button_set_active_block(GTK_TOGGLE_BUTTON(priv->clear), FALSE, toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
466 gtk_webview_clear_formatting(GTK_WEBVIEW(toolbar->webview)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
467 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
468 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
469 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
470 cancel_link_cb(GtkWebViewToolbar *toolbar, PurpleRequestFields *fields) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
471 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
472 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
473 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->link), FALSE); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
474 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
475 priv->link_dialog = NULL; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
476 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
477 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
478 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
479 close_link_dialog(GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
480 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
481 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
482 if (priv->link_dialog != NULL) |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
483 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
484 purple_request_close(PURPLE_REQUEST_FIELDS, priv->link_dialog); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
485 priv->link_dialog = NULL; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
486 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
487 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
488 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
489 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
490 do_insert_link_cb(GtkWebViewToolbar *toolbar, PurpleRequestFields *fields) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
491 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
492 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
493 const char *url, *description; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
494 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
495 url = purple_request_fields_get_string(fields, "url"); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
496 if (gtk_webview_get_format_functions(GTK_WEBVIEW(toolbar->webview)) & GTK_WEBVIEW_LINKDESC) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
497 description = purple_request_fields_get_string(fields, "description"); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
498 else |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
499 description = NULL; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
500 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
501 if (description == NULL) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
502 description = url; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
503 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
504 #if 0 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
505 gtk_webview_insert_link(GTK_WEBVIEW(toolbar->webview), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
506 gtk_text_buffer_get_insert(GTK_WEBVIEW(toolbar->webview)->text_buffer), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
507 url, description); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
508 #endif |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
509 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
510 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->link), FALSE); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
511 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
512 priv->link_dialog = NULL; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
513 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
514 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
515 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
516 insert_link_cb(GtkWidget *w, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
517 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
518 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
519 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->link))) { |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
520 PurpleRequestFields *fields; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
521 PurpleRequestFieldGroup *group; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
522 PurpleRequestField *field; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
523 #if 0 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
524 GtkTextIter start, end; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
525 #endif |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
526 char *msg; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
527 char *desc = NULL; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
528 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
529 fields = purple_request_fields_new(); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
530 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
531 group = purple_request_field_group_new(NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
532 purple_request_fields_add_group(fields, group); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
533 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
534 field = purple_request_field_string_new("url", _("_URL"), NULL, FALSE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
535 purple_request_field_set_required(field, TRUE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
536 purple_request_field_group_add_field(group, field); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
537 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
538 if (gtk_webview_get_format_functions(GTK_WEBVIEW(toolbar->webview)) & GTK_WEBVIEW_LINKDESC) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
539 #if 0 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
540 if (gtk_text_buffer_get_selection_bounds(GTK_WEBVIEW(toolbar->webview)->text_buffer, &start, &end)) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
541 desc = gtk_webview_get_text(GTK_WEBVIEW(toolbar->webview), &start, &end); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
542 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
543 #endif |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
544 field = purple_request_field_string_new("description", _("_Description"), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
545 desc, FALSE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
546 purple_request_field_group_add_field(group, field); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
547 msg = g_strdup(_("Please enter the URL and description of the " |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
548 "link that you want to insert. The description " |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
549 "is optional.")); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
550 } else { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
551 msg = g_strdup(_("Please enter the URL of the " |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
552 "link that you want to insert.")); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
553 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
554 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
555 priv->link_dialog = |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
556 purple_request_fields(toolbar, _("Insert Link"), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
557 NULL, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
558 msg, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
559 fields, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
560 _("_Insert"), G_CALLBACK(do_insert_link_cb), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
561 _("Cancel"), G_CALLBACK(cancel_link_cb), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
562 NULL, NULL, NULL, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
563 toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
564 g_free(msg); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
565 g_free(desc); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
566 } else { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
567 close_link_dialog(toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
568 } |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
569 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
570 gtk_widget_grab_focus(toolbar->webview); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
571 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
572 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
573 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
574 insert_hr_cb(GtkWidget *widget, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
575 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
576 #if 0 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
577 GtkTextIter iter; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
578 GtkTextMark *ins; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
579 GtkIMHtmlScalable *hr; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
580 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
581 ins = gtk_text_buffer_get_insert(gtk_text_view_get_buffer(GTK_TEXT_VIEW(toolbar->webview))); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
582 gtk_text_buffer_get_iter_at_mark(gtk_text_view_get_buffer(GTK_TEXT_VIEW(toolbar->webview)), &iter, ins); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
583 hr = gtk_webview_hr_new(); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
584 gtk_webview_hr_add_to(hr, GTK_WEBVIEW(toolbar->webview), &iter); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
585 #endif |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
586 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
587 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
588 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
589 do_insert_image_cb(GtkWidget *widget, int response, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
590 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
591 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
592 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->image), FALSE); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
593 #if 0 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
594 gchar *filename, *name, *buf; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
595 char *filedata; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
596 size_t size; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
597 GError *error = NULL; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
598 int id; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
599 GtkTextIter iter; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
600 GtkTextMark *ins; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
601 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
602 if (response != GTK_RESPONSE_ACCEPT) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
603 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
604 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->image), FALSE); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
605 return; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
606 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
607 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
608 filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
609 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
610 if (filename == NULL) { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
611 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->image), FALSE); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
612 return; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
613 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
614 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
615 /* The following triggers a callback that closes the widget */ |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
616 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->image), FALSE); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
617 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
618 if (!g_file_get_contents(filename, &filedata, &size, &error)) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
619 purple_notify_error(NULL, NULL, error->message, NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
620 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
621 g_error_free(error); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
622 g_free(filename); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
623 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
624 return; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
625 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
626 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
627 name = strrchr(filename, G_DIR_SEPARATOR) + 1; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
628 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
629 id = purple_imgstore_add_with_id(filedata, size, name); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
630 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
631 if (id == 0) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
632 buf = g_strdup_printf(_("Failed to store image: %s\n"), filename); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
633 purple_notify_error(NULL, NULL, buf, NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
634 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
635 g_free(buf); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
636 g_free(filename); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
637 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
638 return; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
639 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
640 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
641 g_free(filename); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
642 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
643 ins = gtk_text_buffer_get_insert(gtk_text_view_get_buffer(GTK_TEXT_VIEW(toolbar->webview))); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
644 gtk_text_buffer_get_iter_at_mark(gtk_text_view_get_buffer(GTK_TEXT_VIEW(toolbar->webview)), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
645 &iter, ins); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
646 gtk_webview_insert_image_at_iter(GTK_WEBVIEW(toolbar->webview), id, &iter); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
647 purple_imgstore_unref_by_id(id); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
648 #endif |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
649 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
650 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
651 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
652 insert_image_cb(GtkWidget *save, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
653 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
654 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
655 GtkWidget *window; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
656 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
657 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->image))) { |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
658 window = gtk_file_chooser_dialog_new(_("Insert Image"), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
659 NULL, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
660 GTK_FILE_CHOOSER_ACTION_OPEN, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
661 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
662 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
663 NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
664 gtk_dialog_set_default_response(GTK_DIALOG(window), GTK_RESPONSE_ACCEPT); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
665 g_signal_connect(G_OBJECT(GTK_FILE_CHOOSER(window)), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
666 "response", G_CALLBACK(do_insert_image_cb), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
667 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
668 gtk_widget_show(window); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
669 priv->image_dialog = window; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
670 } else { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
671 gtk_widget_destroy(priv->image_dialog); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
672 priv->image_dialog = NULL; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
673 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
674 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
675 gtk_widget_grab_focus(toolbar->webview); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
676 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
677 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
678 #if 0 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
679 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
680 destroy_smiley_dialog(GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
681 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
682 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
683 if (priv->smiley_dialog != NULL) |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
684 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
685 gtk_widget_destroy(priv->smiley_dialog); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
686 priv->smiley_dialog = NULL; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
687 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
688 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
689 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
690 static gboolean |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
691 close_smiley_dialog(GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
692 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
693 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
694 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->smiley), FALSE); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
695 return FALSE; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
696 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
697 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
698 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
699 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
700 insert_smiley_text(GtkWidget *widget, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
701 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
702 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
703 char *smiley_text, *escaped_smiley; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
704 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
705 smiley_text = g_object_get_data(G_OBJECT(widget), "smiley_text"); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
706 escaped_smiley = g_markup_escape_text(smiley_text, -1); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
707 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
708 gtk_webview_insert_smiley(GTK_WEBVIEW(toolbar->webview), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
709 GTK_WEBVIEW(toolbar->webview)->protocol_name, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
710 escaped_smiley); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
711 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
712 g_free(escaped_smiley); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
713 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
714 close_smiley_dialog(toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
715 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
716 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
717 /* smiley buttons list */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
718 struct smiley_button_list { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
719 int width, height; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
720 GtkWidget *button; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
721 const GtkIMHtmlSmiley *smiley; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
722 struct smiley_button_list *next; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
723 }; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
724 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
725 static struct smiley_button_list * |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
726 sort_smileys(struct smiley_button_list *ls, GtkWebViewToolbar *toolbar, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
727 int *width, const GtkIMHtmlSmiley *smiley) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
728 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
729 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
730 GtkWidget *image; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
731 GtkWidget *button; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
732 GtkRequisition size; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
733 struct smiley_button_list *cur; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
734 struct smiley_button_list *it, *it_last; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
735 const gchar *filename = smiley->file; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
736 gchar *face = smiley->smile; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
737 PurpleSmiley *psmiley = NULL; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
738 gboolean supports_custom = (gtk_webview_get_format_functions(GTK_WEBVIEW(toolbar->webview)) & GTK_WEBVIEW_CUSTOM_SMILEY); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
739 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
740 cur = g_new0(struct smiley_button_list, 1); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
741 it = ls; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
742 it_last = ls; /* list iterators*/ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
743 image = gtk_image_new_from_file(filename); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
744 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
745 gtk_widget_size_request(image, &size); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
746 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
747 if (size.width > 24 && |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
748 smiley->flags & GTK_WEBVIEW_SMILEY_CUSTOM) { /* This is a custom smiley, let's scale it */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
749 GdkPixbuf *pixbuf = NULL; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
750 GtkImageType type; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
751 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
752 type = gtk_image_get_storage_type(GTK_IMAGE(image)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
753 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
754 if (type == GTK_IMAGE_PIXBUF) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
755 pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(image)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
756 } else if (type == GTK_IMAGE_ANIMATION) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
757 GdkPixbufAnimation *animation; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
758 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
759 animation = gtk_image_get_animation(GTK_IMAGE(image)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
760 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
761 pixbuf = gdk_pixbuf_animation_get_static_image(animation); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
762 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
763 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
764 if (pixbuf != NULL) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
765 GdkPixbuf *resized; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
766 resized = gdk_pixbuf_scale_simple(pixbuf, 24, 24, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
767 GDK_INTERP_HYPER); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
768 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
769 gtk_image_set_from_pixbuf(GTK_IMAGE(image), resized); /* This unrefs pixbuf */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
770 gtk_widget_size_request(image, &size); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
771 g_object_unref(G_OBJECT(resized)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
772 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
773 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
774 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
775 (*width) += size.width; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
776 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
777 button = gtk_button_new(); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
778 gtk_container_add(GTK_CONTAINER(button), image); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
779 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
780 g_object_set_data(G_OBJECT(button), "smiley_text", face); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
781 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(insert_smiley_text), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
782 |
32465
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
783 gtk_widget_set_tooltip_text(button, face); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
784 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
785 /* these look really weird with borders */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
786 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
787 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
788 psmiley = purple_smileys_find_by_shortcut(smiley->smile); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
789 /* If this is a "non-custom" smiley, check to see if its shortcut is |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
790 "shadowed" by any custom smiley. This can only happen if the connection |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
791 is custom smiley-enabled */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
792 if (supports_custom && psmiley && !(smiley->flags & GTK_WEBVIEW_SMILEY_CUSTOM)) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
793 gchar tip[128]; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
794 g_snprintf(tip, sizeof(tip), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
795 _("This smiley is disabled because a custom smiley exists for this shortcut:\n %s"), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
796 face); |
32465
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
797 gtk_widget_set_tooltip_text(button, tip); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
798 gtk_widget_set_sensitive(button, FALSE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
799 } else if (psmiley) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
800 /* Remove the button if the smiley is destroyed */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
801 g_signal_connect_object(G_OBJECT(psmiley), "destroy", G_CALLBACK(gtk_widget_destroy), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
802 button, G_CONNECT_SWAPPED); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
803 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
804 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
805 /* set current element to add */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
806 cur->height = size.height; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
807 cur->width = size.width; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
808 cur->button = button; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
809 cur->smiley = smiley; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
810 cur->next = ls; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
811 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
812 /* check where to insert by height */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
813 if (ls == NULL) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
814 return cur; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
815 while (it != NULL) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
816 it_last = it; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
817 it = it->next; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
818 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
819 cur->next = it; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
820 it_last->next = cur; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
821 return ls; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
822 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
823 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
824 static gboolean |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
825 smiley_is_unique(GSList *list, GtkIMHtmlSmiley *smiley) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
826 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
827 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
828 while (list) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
829 GtkIMHtmlSmiley *cur = (GtkIMHtmlSmiley *) list->data; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
830 if (!strcmp(cur->file, smiley->file)) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
831 return FALSE; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
832 list = list->next; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
833 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
834 return TRUE; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
835 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
836 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
837 static gboolean |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
838 smiley_dialog_input_cb(GtkWidget *dialog, GdkEvent *event, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
839 GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
840 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
841 if ((event->type == GDK_KEY_PRESS && event->key.keyval == GDK_Escape) || |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
842 (event->type == GDK_BUTTON_PRESS && event->button.button == 1)) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
843 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
844 close_smiley_dialog(toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
845 return TRUE; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
846 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
847 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
848 return FALSE; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
849 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
850 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
851 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
852 add_smiley_list(GtkWidget *container, struct smiley_button_list *list, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
853 int max_width, gboolean custom) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
854 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
855 GtkWidget *line; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
856 int line_width = 0; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
857 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
858 if (!list) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
859 return; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
860 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
861 line = gtk_hbox_new(FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
862 gtk_box_pack_start(GTK_BOX(container), line, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
863 for (; list; list = list->next) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
864 if (custom != !!(list->smiley->flags & GTK_WEBVIEW_SMILEY_CUSTOM)) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
865 continue; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
866 gtk_box_pack_start(GTK_BOX(line), list->button, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
867 gtk_widget_show(list->button); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
868 line_width += list->width; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
869 if (line_width >= max_width) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
870 if (list->next) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
871 line = gtk_hbox_new(FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
872 gtk_box_pack_start(GTK_BOX(container), line, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
873 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
874 line_width = 0; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
875 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
876 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
877 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
878 #endif |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
879 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
880 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
881 insert_smiley_cb(GtkWidget *smiley, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
882 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
883 #if 0 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
884 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
885 GtkWidget *dialog, *vbox; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
886 GtkWidget *smiley_table = NULL; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
887 GSList *smileys, *unique_smileys = NULL; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
888 const GSList *custom_smileys = NULL; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
889 gboolean supports_custom = FALSE; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
890 GtkRequisition req; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
891 GtkWidget *scrolled, *viewport; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
892 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
893 if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(smiley))) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
894 destroy_smiley_dialog(toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
895 gtk_widget_grab_focus(toolbar->webview); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
896 return; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
897 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
898 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
899 if (priv->sml) |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
900 smileys = pidgin_themes_get_proto_smileys(priv->sml); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
901 else |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
902 smileys = pidgin_themes_get_proto_smileys(NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
903 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
904 /* Note: prepend smileys to list to avoid O(n^2) overhead when there is |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
905 a large number of smileys... need to revers the list after for the dialog |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
906 work... */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
907 while(smileys) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
908 GtkIMHtmlSmiley *smiley = (GtkIMHtmlSmiley *) smileys->data; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
909 if(!smiley->hidden) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
910 if(smiley_is_unique(unique_smileys, smiley)) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
911 unique_smileys = g_slist_prepend(unique_smileys, smiley); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
912 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
913 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
914 smileys = smileys->next; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
915 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
916 supports_custom = (gtk_webview_get_format_functions(GTK_WEBVIEW(toolbar->webview)) & GTK_WEBVIEW_CUSTOM_SMILEY); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
917 if (toolbar->webview && supports_custom) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
918 const GSList *iterator = NULL; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
919 custom_smileys = pidgin_smileys_get_all(); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
920 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
921 for (iterator = custom_smileys ; iterator ; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
922 iterator = g_slist_next(iterator)) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
923 GtkIMHtmlSmiley *smiley = (GtkIMHtmlSmiley *) iterator->data; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
924 unique_smileys = g_slist_prepend(unique_smileys, smiley); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
925 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
926 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
927 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
928 /* we need to reverse the list to get the smileys in the correct order */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
929 unique_smileys = g_slist_reverse(unique_smileys); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
930 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
931 dialog = pidgin_create_dialog(_("Smile!"), 0, "smiley_dialog", FALSE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
932 gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
933 vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(dialog), FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
934 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
935 if (unique_smileys != NULL) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
936 struct smiley_button_list *ls; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
937 int max_line_width, num_lines, button_width = 0; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
938 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
939 /* We use hboxes packed in a vbox */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
940 ls = NULL; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
941 max_line_width = 0; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
942 num_lines = floor(sqrt(g_slist_length(unique_smileys))); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
943 smiley_table = gtk_vbox_new(FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
944 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
945 if (supports_custom) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
946 GtkWidget *manage = gtk_button_new_with_mnemonic(_("_Manage custom smileys")); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
947 GtkRequisition req; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
948 g_signal_connect(G_OBJECT(manage), "clicked", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
949 G_CALLBACK(pidgin_smiley_manager_show), NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
950 g_signal_connect_swapped(G_OBJECT(manage), "clicked", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
951 G_CALLBACK(gtk_widget_destroy), dialog); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
952 gtk_box_pack_end(GTK_BOX(vbox), manage, FALSE, TRUE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
953 gtk_widget_size_request(manage, &req); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
954 button_width = req.width; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
955 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
956 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
957 /* create list of smileys sorted by height */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
958 while (unique_smileys) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
959 GtkIMHtmlSmiley *smiley = (GtkIMHtmlSmiley *) unique_smileys->data; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
960 if (!smiley->hidden) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
961 ls = sort_smileys(ls, toolbar, &max_line_width, smiley); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
962 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
963 unique_smileys = g_slist_delete_link(unique_smileys, unique_smileys); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
964 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
965 /* The window will be at least as wide as the 'Manage ..' button */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
966 max_line_width = MAX(button_width, max_line_width / num_lines); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
967 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
968 /* pack buttons of the list */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
969 add_smiley_list(smiley_table, ls, max_line_width, FALSE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
970 if (supports_custom) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
971 gtk_box_pack_start(GTK_BOX(smiley_table), gtk_hseparator_new(), TRUE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
972 add_smiley_list(smiley_table, ls, max_line_width, TRUE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
973 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
974 while (ls) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
975 struct smiley_button_list *tmp = ls->next; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
976 g_free(ls); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
977 ls = tmp; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
978 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
979 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
980 gtk_widget_add_events(dialog, GDK_KEY_PRESS_MASK); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
981 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
982 else { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
983 smiley_table = gtk_label_new(_("This theme has no available smileys.")); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
984 gtk_widget_add_events(dialog, GDK_KEY_PRESS_MASK | GDK_BUTTON_PRESS_MASK); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
985 g_signal_connect(G_OBJECT(dialog), "button-press-event", (GCallback)smiley_dialog_input_cb, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
986 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
987 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
988 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
989 scrolled = pidgin_make_scrollable(smiley_table, GTK_POLICY_NEVER, GTK_POLICY_NEVER, GTK_SHADOW_NONE, -1, -1); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
990 gtk_box_pack_start(GTK_BOX(vbox), scrolled, TRUE, TRUE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
991 gtk_widget_show(smiley_table); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
992 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
993 viewport = gtk_widget_get_parent(smiley_table); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
994 gtk_viewport_set_shadow_type(GTK_VIEWPORT(viewport), GTK_SHADOW_NONE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
995 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
996 /* connect signals */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
997 g_signal_connect_swapped(G_OBJECT(dialog), "destroy", G_CALLBACK(close_smiley_dialog), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
998 g_signal_connect(G_OBJECT(dialog), "key-press-event", G_CALLBACK(smiley_dialog_input_cb), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
999 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1000 gtk_window_set_transient_for(GTK_WINDOW(dialog), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1001 GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(toolbar)))); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1002 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1003 /* show everything */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1004 gtk_widget_show_all(dialog); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1005 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1006 gtk_widget_size_request(viewport, &req); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1007 gtk_widget_set_size_request(scrolled, MIN(300, req.width), MIN(290, req.height)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1008 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1009 /* The window has to be made resizable, and the scrollbars in the scrolled window |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1010 * enabled only after setting the desired size of the window. If we do either of |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1011 * these tasks before now, GTK+ miscalculates the required size, and erronously |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1012 * makes one or both scrollbars visible (sometimes). |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1013 * I too think this hack is gross. But I couldn't find a better way -- sadrul */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1014 gtk_window_set_resizable(GTK_WINDOW(dialog), TRUE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1015 g_object_set(G_OBJECT(scrolled), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1016 "hscrollbar-policy", GTK_POLICY_AUTOMATIC, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1017 "vscrollbar-policy", GTK_POLICY_AUTOMATIC, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1018 NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1019 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1020 #ifdef _WIN32 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1021 winpidgin_ensure_onscreen(dialog); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1022 #endif |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1023 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1024 priv->smiley_dialog = dialog; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1025 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1026 gtk_widget_grab_focus(toolbar->webview); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1027 #endif |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1028 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1029 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1030 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1031 send_attention_cb(GtkWidget *attention, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1032 { |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1033 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1034 PurpleConversation *conv = priv->active_conv; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1035 const gchar *who = purple_conversation_get_name(conv); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1036 PurpleConnection *gc = purple_conversation_get_connection(conv); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1037 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1038 toggle_button_set_active_block(GTK_TOGGLE_BUTTON(attention), FALSE, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1039 purple_prpl_send_attention(gc, who, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1040 gtk_widget_grab_focus(toolbar->webview); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1041 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1042 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1043 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1044 update_buttons_cb(GtkWebView *webview, GtkWebViewButtons buttons, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1045 GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1046 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1047 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1048 gtk_widget_set_sensitive(GTK_WIDGET(priv->bold), buttons & GTK_WEBVIEW_BOLD); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1049 gtk_widget_set_sensitive(GTK_WIDGET(priv->italic), buttons & GTK_WEBVIEW_ITALIC); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1050 gtk_widget_set_sensitive(GTK_WIDGET(priv->underline), buttons & GTK_WEBVIEW_UNDERLINE); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1051 gtk_widget_set_sensitive(GTK_WIDGET(priv->strike), buttons & GTK_WEBVIEW_STRIKE); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1052 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1053 gtk_widget_set_sensitive(GTK_WIDGET(priv->larger_size), buttons & GTK_WEBVIEW_GROW); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1054 gtk_widget_set_sensitive(GTK_WIDGET(priv->smaller_size), buttons & GTK_WEBVIEW_SHRINK); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1055 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1056 gtk_widget_set_sensitive(GTK_WIDGET(priv->font), buttons & GTK_WEBVIEW_FACE); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1057 gtk_widget_set_sensitive(GTK_WIDGET(priv->fgcolor), buttons & GTK_WEBVIEW_FORECOLOR); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1058 gtk_widget_set_sensitive(GTK_WIDGET(priv->bgcolor), buttons & GTK_WEBVIEW_BACKCOLOR); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1059 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1060 gtk_widget_set_sensitive(GTK_WIDGET(priv->clear), |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1061 (buttons & GTK_WEBVIEW_BOLD || |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1062 buttons & GTK_WEBVIEW_ITALIC || |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1063 buttons & GTK_WEBVIEW_UNDERLINE || |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1064 buttons & GTK_WEBVIEW_STRIKE || |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1065 buttons & GTK_WEBVIEW_GROW || |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1066 buttons & GTK_WEBVIEW_SHRINK || |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1067 buttons & GTK_WEBVIEW_FACE || |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1068 buttons & GTK_WEBVIEW_FORECOLOR || |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1069 buttons & GTK_WEBVIEW_BACKCOLOR)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1070 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1071 gtk_widget_set_sensitive(GTK_WIDGET(priv->image), buttons & GTK_WEBVIEW_IMAGE); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1072 gtk_widget_set_sensitive(GTK_WIDGET(priv->link), buttons & GTK_WEBVIEW_LINK); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1073 gtk_widget_set_sensitive(GTK_WIDGET(priv->smiley), buttons & GTK_WEBVIEW_SMILEY); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1074 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1075 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1076 /* we call this when we want to _set_active the toggle button, it'll |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1077 * block the callback thats connected to the button so we don't have to |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1078 * do the double toggling hack |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1079 */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1080 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1081 toggle_button_set_active_block(GtkToggleButton *button, gboolean is_active, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1082 GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1083 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1084 GObject *object; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1085 g_return_if_fail(toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1086 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1087 object = g_object_ref(button); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1088 g_signal_handlers_block_matched(object, G_SIGNAL_MATCH_DATA, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1089 0, 0, NULL, NULL, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1090 gtk_toggle_button_set_active(button, is_active); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1091 g_signal_handlers_unblock_matched(object, G_SIGNAL_MATCH_DATA, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1092 0, 0, NULL, NULL, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1093 g_object_unref(object); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1094 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1095 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1096 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1097 update_buttons(GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1098 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1099 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1100 gboolean bold, italic, underline, strike; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1101 const char *tmp; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1102 const char *tmp2; |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1103 GtkLabel *label = GTK_LABEL(priv->font_label); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1104 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1105 gtk_label_set_label(label, _("_Font")); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1106 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1107 gtk_webview_get_current_format(GTK_WEBVIEW(toolbar->webview), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1108 &bold, &italic, &underline, &strike); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1109 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1110 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->bold)) != bold) |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1111 toggle_button_set_active_block(GTK_TOGGLE_BUTTON(priv->bold), bold, |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1112 toolbar); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1113 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->italic)) != italic) |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1114 toggle_button_set_active_block(GTK_TOGGLE_BUTTON(priv->italic), italic, |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1115 toolbar); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1116 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->underline)) != underline) |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1117 toggle_button_set_active_block(GTK_TOGGLE_BUTTON(priv->underline), |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1118 underline, toolbar); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1119 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->strike)) != strike) |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1120 toggle_button_set_active_block(GTK_TOGGLE_BUTTON(priv->strike), |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1121 strike, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1122 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1123 /* These buttons aren't ever "active". */ |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1124 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->smaller_size), FALSE); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1125 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->larger_size), FALSE); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1126 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1127 if (bold) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1128 gchar *markup = g_strdup_printf("<b>%s</b>", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1129 gtk_label_get_label(label)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1130 gtk_label_set_markup_with_mnemonic(label, markup); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1131 g_free(markup); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1132 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1133 if (italic) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1134 gchar *markup = g_strdup_printf("<i>%s</i>", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1135 gtk_label_get_label(label)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1136 gtk_label_set_markup_with_mnemonic(label, markup); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1137 g_free(markup); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1138 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1139 if (underline) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1140 gchar *markup = g_strdup_printf("<u>%s</u>", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1141 gtk_label_get_label(label)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1142 gtk_label_set_markup_with_mnemonic(label, markup); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1143 g_free(markup); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1144 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1145 if (strike) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1146 gchar *markup = g_strdup_printf("<s>%s</s>", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1147 gtk_label_get_label(label)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1148 gtk_label_set_markup_with_mnemonic(label, markup); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1149 g_free(markup); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1150 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1151 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1152 tmp = gtk_webview_get_current_fontface(GTK_WEBVIEW(toolbar->webview)); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1153 toggle_button_set_active_block(GTK_TOGGLE_BUTTON(priv->font), |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1154 (tmp != NULL), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1155 if (tmp != NULL) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1156 gchar *markup = g_strdup_printf("<span font_desc=\"%s\">%s</span>", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1157 tmp, gtk_label_get_label(label)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1158 gtk_label_set_markup_with_mnemonic(label, markup); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1159 g_free(markup); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1160 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1161 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1162 tmp = gtk_webview_get_current_forecolor(GTK_WEBVIEW(toolbar->webview)); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1163 toggle_button_set_active_block(GTK_TOGGLE_BUTTON(priv->fgcolor), |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1164 (tmp != NULL), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1165 if (tmp != NULL) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1166 gchar *markup = g_strdup_printf("<span foreground=\"%s\">%s</span>", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1167 tmp, gtk_label_get_label(label)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1168 gtk_label_set_markup_with_mnemonic(label, markup); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1169 g_free(markup); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1170 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1171 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1172 tmp = gtk_webview_get_current_backcolor(GTK_WEBVIEW(toolbar->webview)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1173 tmp2 = gtk_webview_get_current_background(GTK_WEBVIEW(toolbar->webview)); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1174 toggle_button_set_active_block(GTK_TOGGLE_BUTTON(priv->bgcolor), |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1175 (tmp != NULL || tmp2 != NULL), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1176 if (tmp != NULL) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1177 gchar *markup = g_strdup_printf("<span background=\"%s\">%s</span>", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1178 tmp, gtk_label_get_label(label)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1179 gtk_label_set_markup_with_mnemonic(label, markup); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1180 g_free(markup); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1181 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1182 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1183 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1184 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1185 toggle_button_cb(GtkWebView *webview, GtkWebViewButtons buttons, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1186 GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1187 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1188 update_buttons(toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1189 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1190 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1191 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1192 update_format_cb(GtkWebView *webview, GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1193 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1194 update_buttons(toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1195 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1196 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1197 #if 0 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1198 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1199 mark_set_cb(GtkTextBuffer *buffer, GtkTextIter *location, GtkTextMark *mark, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1200 GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1201 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1202 if(mark != gtk_text_buffer_get_insert(buffer)) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1203 return; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1204 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1205 update_buttons(toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1206 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1207 #endif |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1208 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1209 /* This comes from gtkmenutoolbutton.c from gtk+ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1210 * Copyright (C) 2003 Ricardo Fernandez Pascual |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1211 * Copyright (C) 2004 Paolo Borelli |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1212 */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1213 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1214 menu_position_func(GtkMenu *menu, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1215 int *x, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1216 int *y, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1217 gboolean *push_in, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1218 gpointer data) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1219 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1220 GtkWidget *widget = GTK_WIDGET(data); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1221 GtkRequisition menu_req; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1222 gint ythickness = widget->style->ythickness; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1223 int savy; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1224 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1225 gtk_widget_size_request(GTK_WIDGET (menu), &menu_req); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1226 gdk_window_get_origin(widget->window, x, y); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1227 *x += widget->allocation.x; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1228 *y += widget->allocation.y + widget->allocation.height; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1229 savy = *y; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1230 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1231 pidgin_menu_position_func_helper(menu, x, y, push_in, data); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1232 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1233 if (savy > *y + ythickness + 1) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1234 *y -= widget->allocation.height; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1235 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1236 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1237 static gboolean |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1238 button_activate_on_click(GtkWidget *button, GdkEventButton *event, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1239 GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1240 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1241 if (event->button == 1 && GTK_IS_TOGGLE_BUTTON(button)) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1242 gtk_widget_activate(button); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1243 else if (event->button == 3) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1244 return gtk_webviewtoolbar_popup_menu(button, event, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1245 return FALSE; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1246 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1247 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1248 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1249 pidgin_menu_clicked(GtkWidget *button, GtkMenu *menu) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1250 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1251 gtk_widget_show_all(GTK_WIDGET(menu)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1252 gtk_menu_popup(menu, NULL, NULL, menu_position_func, button, 0, gtk_get_current_event_time()); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1253 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1254 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1255 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1256 pidgin_menu_deactivate(GtkWidget *menu, GtkToggleButton *button) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1257 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1258 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), FALSE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1259 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1260 |
32460
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1261 static void |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1262 switch_toolbar_view(GtkWidget *item, GtkWebViewToolbar *toolbar) |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1263 { |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1264 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/wide", |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1265 !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/wide")); |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1266 } |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1267 |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1268 static gboolean |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1269 gtk_webviewtoolbar_popup_menu(GtkWidget *widget, GdkEventButton *event, |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1270 GtkWebViewToolbar *toolbar) |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1271 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1272 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32460
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1273 GtkWidget *menu; |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1274 GtkWidget *item; |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1275 gboolean wide; |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1276 |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1277 if (event->button != 3) |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1278 return FALSE; |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1279 |
32465
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
1280 wide = gtk_widget_get_visible(priv->bold); |
32460
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1281 |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1282 menu = gtk_menu_new(); |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1283 item = gtk_menu_item_new_with_mnemonic(wide ? _("Group Items") : _("Ungroup Items")); |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1284 g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(switch_toolbar_view), toolbar); |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1285 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1286 gtk_widget_show(item); |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1287 |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1288 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, pidgin_menu_position_func_helper, |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1289 widget, event->button, event->time); |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1290 return TRUE; |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1291 } |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1292 |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1293 static void |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1294 button_visibility_changed(GtkWidget *button, gpointer dontcare, GtkWidget *item) |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1295 { |
32465
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
1296 if (gtk_widget_get_visible(button)) |
32460
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1297 gtk_widget_hide(item); |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1298 else |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1299 gtk_widget_show(item); |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1300 } |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1301 |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1302 static void |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1303 button_sensitiveness_changed(GtkWidget *button, gpointer dontcare, GtkWidget *item) |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1304 { |
32465
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
1305 gtk_widget_set_sensitive(item, gtk_widget_is_sensitive(button)); |
32460
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1306 } |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1307 |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1308 static void |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1309 update_menuitem(GtkToggleButton *button, GtkCheckMenuItem *item) |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1310 { |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1311 g_signal_handlers_block_by_func(G_OBJECT(item), G_CALLBACK(gtk_button_clicked), button); |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1312 gtk_check_menu_item_set_active(item, gtk_toggle_button_get_active(button)); |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1313 g_signal_handlers_unblock_by_func(G_OBJECT(item), G_CALLBACK(gtk_button_clicked), button); |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1314 } |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1315 |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1316 static void |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1317 enable_markup(GtkWidget *widget, gpointer null) |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1318 { |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1319 if (GTK_IS_LABEL(widget)) |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1320 g_object_set(G_OBJECT(widget), "use-markup", TRUE, NULL); |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1321 } |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1322 |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1323 static void |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1324 webviewtoolbar_view_pref_changed(const char *name, PurplePrefType type, |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1325 gconstpointer value, gpointer toolbar) |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1326 { |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1327 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32460
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1328 if (value) { |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1329 gtk_widget_hide_all(priv->lean_view); |
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1330 gtk_widget_show_all(priv->wide_view); |
32460
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1331 } else { |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1332 gtk_widget_hide_all(priv->wide_view); |
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1333 gtk_widget_show_all(priv->lean_view); |
32460
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1334 } |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1335 } |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1336 |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1337 /****************************************************************************** |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1338 * GObject stuff |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1339 *****************************************************************************/ |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1340 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1341 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1342 gtk_webviewtoolbar_finalize(GObject *object) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1343 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1344 GtkWebViewToolbar *toolbar = GTK_WEBVIEWTOOLBAR(object); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1345 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1346 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1347 if (priv->image_dialog != NULL) |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1348 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1349 gtk_widget_destroy(priv->image_dialog); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1350 priv->image_dialog = NULL; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1351 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1352 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1353 destroy_toolbar_font(NULL, NULL, toolbar); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1354 if (priv->smiley_dialog != NULL) { |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1355 #if 0 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1356 g_signal_handlers_disconnect_by_func(G_OBJECT(priv->smiley_dialog), close_smiley_dialog, toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1357 destroy_smiley_dialog(toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1358 #endif |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1359 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1360 destroy_toolbar_bgcolor(NULL, NULL, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1361 destroy_toolbar_fgcolor(NULL, NULL, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1362 close_link_dialog(toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1363 if (toolbar->webview) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1364 g_signal_handlers_disconnect_matched(toolbar->webview, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1365 G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1366 toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1367 #if 0 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1368 g_signal_handlers_disconnect_matched(GTK_WEBVIEW(toolbar->webview)->text_buffer, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1369 G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1370 toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1371 #endif |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1372 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1373 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1374 g_free(priv->sml); |
32465
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
1375 |
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
1376 #if !GTK_CHECK_VERSION(2,12,0) |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1377 gtk_object_sink(GTK_OBJECT(priv->tooltips)); |
32465
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
1378 #endif |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1379 |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1380 if (priv->font_menu) |
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1381 gtk_widget_destroy(priv->font_menu); |
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1382 if (priv->insert_menu) |
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1383 gtk_widget_destroy(priv->insert_menu); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1384 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1385 purple_prefs_disconnect_by_handle(object); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1386 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1387 G_OBJECT_CLASS(parent_class)->finalize (object); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1388 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1389 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1390 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1391 gtk_webviewtoolbar_class_init(GtkWebViewToolbarClass *class) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1392 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1393 GObjectClass *gobject_class; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1394 gobject_class = (GObjectClass *)class; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1395 parent_class = g_type_class_ref(GTK_TYPE_HBOX); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1396 gobject_class->finalize = gtk_webviewtoolbar_finalize; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1397 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1398 g_type_class_add_private(class, sizeof(GtkWebViewToolbarPriv)); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1399 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1400 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations/toolbar"); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1401 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/wide", FALSE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1402 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1403 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1404 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1405 gtk_webviewtoolbar_create_old_buttons(GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1406 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1407 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1408 GtkWidget *hbox; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1409 GtkWidget *button; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1410 struct { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1411 char *stock; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1412 gpointer callback; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1413 GtkWidget **button; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1414 const char *tooltip; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1415 } buttons[] = { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1416 {GTK_STOCK_BOLD, G_CALLBACK(do_bold), &priv->bold, _("Bold")}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1417 {GTK_STOCK_ITALIC, do_italic, &priv->italic, _("Italic")}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1418 {GTK_STOCK_UNDERLINE, do_underline, &priv->underline, _("Underline")}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1419 {GTK_STOCK_STRIKETHROUGH, do_strikethrough, &priv->strike, _("Strikethrough")}, |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1420 {"", NULL, NULL, NULL}, |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1421 {PIDGIN_STOCK_TOOLBAR_TEXT_LARGER, do_big, &priv->larger_size, _("Increase Font Size")}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1422 {PIDGIN_STOCK_TOOLBAR_TEXT_SMALLER, do_small, &priv->smaller_size, _("Decrease Font Size")}, |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1423 {"", NULL, NULL, NULL}, |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1424 {PIDGIN_STOCK_TOOLBAR_FONT_FACE, toggle_font, &priv->font, _("Font Face")}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1425 {PIDGIN_STOCK_TOOLBAR_FGCOLOR, toggle_fg_color, &priv->fgcolor, _("Foreground Color")}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1426 {PIDGIN_STOCK_TOOLBAR_BGCOLOR, toggle_bg_color, &priv->bgcolor, _("Background Color")}, |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1427 {"", NULL, NULL, NULL}, |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1428 {PIDGIN_STOCK_CLEAR, clear_formatting_cb, &priv->clear, _("Reset Formatting")}, |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1429 {"", NULL, NULL, NULL}, |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1430 {PIDGIN_STOCK_TOOLBAR_INSERT_IMAGE, insert_image_cb, &priv->image, _("Insert IM Image")}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1431 {PIDGIN_STOCK_TOOLBAR_INSERT_LINK, insert_link_cb, &priv->link, _("Insert Link")}, |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1432 {"", NULL, NULL, NULL}, |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1433 {PIDGIN_STOCK_TOOLBAR_SMILEY, insert_smiley_cb, &priv->smiley, _("Insert Smiley")}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1434 {PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION, send_attention_cb, &priv->attention, _("Send Attention")}, |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1435 {NULL, NULL, NULL, NULL} |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1436 }; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1437 int iter; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1438 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1439 hbox = gtk_hbox_new(FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1440 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1441 for (iter = 0; buttons[iter].stock; iter++) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1442 if (buttons[iter].stock[0]) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1443 button = pidgin_pixbuf_toolbar_button_from_stock(buttons[iter].stock); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1444 g_signal_connect(G_OBJECT(button), "button-press-event", G_CALLBACK(gtk_webviewtoolbar_popup_menu), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1445 g_signal_connect(G_OBJECT(button), "clicked", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1446 G_CALLBACK(buttons[iter].callback), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1447 *(buttons[iter].button) = button; |
32465
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
1448 gtk_widget_set_tooltip_text(button, buttons[iter].tooltip); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1449 } else |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1450 button = gtk_vseparator_new(); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1451 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1452 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1453 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1454 gtk_box_pack_start(GTK_BOX(toolbar), hbox, FALSE, FALSE, 0); |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1455 priv->wide_view = hbox; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1456 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1457 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1458 static void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1459 gtk_webviewtoolbar_init(GtkWebViewToolbar *toolbar) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1460 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1461 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1462 GtkWidget *hbox = GTK_WIDGET(toolbar), *event = gtk_event_box_new(); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1463 GtkWidget *bbox, *box = gtk_hbox_new(FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1464 GtkWidget *image; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1465 GtkWidget *label; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1466 GtkWidget *insert_button; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1467 GtkWidget *font_button; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1468 GtkWidget *smiley_button; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1469 GtkWidget *attention_button; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1470 GtkWidget *font_menu; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1471 GtkWidget *insert_menu; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1472 GtkWidget *menuitem; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1473 GtkWidget *sep; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1474 int i; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1475 struct { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1476 const char *label; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1477 GtkWidget **button; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1478 gboolean check; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1479 } buttons[] = { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1480 {_("<b>_Bold</b>"), &priv->bold, TRUE}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1481 {_("<i>_Italic</i>"), &priv->italic, TRUE}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1482 {_("<u>_Underline</u>"), &priv->underline, TRUE}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1483 {_("<span strikethrough='true'>Strikethrough</span>"), &priv->strike, TRUE}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1484 {_("<span size='larger'>_Larger</span>"), &priv->larger_size, TRUE}, |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1485 #if 0 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1486 {_("_Normal"), &priv->normal_size, TRUE}, |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1487 #endif |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1488 {_("<span size='smaller'>_Smaller</span>"), &priv->smaller_size, TRUE}, |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1489 /* If we want to show the formatting for the following items, we would |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1490 * need to update them when formatting changes. The above items don't need |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1491 * no updating nor nothin' */ |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1492 {_("_Font face"), &priv->font, TRUE}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1493 {_("Foreground _color"), &priv->fgcolor, TRUE}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1494 {_("Bac_kground color"), &priv->bgcolor, TRUE}, |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1495 {_("_Reset formatting"), &priv->clear, FALSE}, |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1496 {NULL, NULL, FALSE} |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1497 }; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1498 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1499 toolbar->webview = NULL; |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1500 priv->font_dialog = NULL; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1501 priv->fgcolor_dialog = NULL; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1502 priv->bgcolor_dialog = NULL; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1503 priv->link_dialog = NULL; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1504 priv->smiley_dialog = NULL; |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1505 priv->image_dialog = NULL; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1506 |
32465
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
1507 #if !GTK_CHECK_VERSION(2,12,0) |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1508 priv->tooltips = gtk_tooltips_new(); |
32465
783ac40a7408
Add some GTK+3 compatible updates.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32464
diff
changeset
|
1509 #endif |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1510 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1511 gtk_box_set_spacing(GTK_BOX(toolbar), 3); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1512 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1513 gtk_webviewtoolbar_create_old_buttons(toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1514 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1515 /* Fonts */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1516 font_button = gtk_toggle_button_new(); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1517 gtk_button_set_relief(GTK_BUTTON(font_button), GTK_RELIEF_NONE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1518 bbox = gtk_hbox_new(FALSE, 3); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1519 gtk_container_add(GTK_CONTAINER(font_button), bbox); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1520 image = gtk_image_new_from_stock(GTK_STOCK_BOLD, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1521 gtk_box_pack_start(GTK_BOX(bbox), image, FALSE, FALSE, 0); |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1522 priv->font_label = label = gtk_label_new_with_mnemonic(_("_Font")); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1523 gtk_label_set_use_markup(GTK_LABEL(label), TRUE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1524 gtk_box_pack_start(GTK_BOX(bbox), label, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1525 gtk_box_pack_start(GTK_BOX(box), font_button, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1526 gtk_widget_show_all(font_button); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1527 |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1528 priv->font_menu = font_menu = gtk_menu_new(); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1529 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1530 for (i = 0; buttons[i].label; i++) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1531 GtkWidget *old = *buttons[i].button; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1532 if (buttons[i].check) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1533 menuitem = gtk_check_menu_item_new_with_mnemonic(buttons[i].label); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1534 g_signal_connect_after(G_OBJECT(old), "toggled", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1535 G_CALLBACK(update_menuitem), menuitem); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1536 } else { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1537 menuitem = gtk_menu_item_new_with_mnemonic(buttons[i].label); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1538 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1539 g_signal_connect_swapped(G_OBJECT(menuitem), "activate", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1540 G_CALLBACK(gtk_button_clicked), old); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1541 gtk_menu_shell_append(GTK_MENU_SHELL(font_menu), menuitem); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1542 g_signal_connect(G_OBJECT(old), "notify::sensitive", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1543 G_CALLBACK(button_sensitiveness_changed), menuitem); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1544 g_signal_connect(G_OBJECT(old), "notify::visible", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1545 G_CALLBACK(button_visibility_changed), menuitem); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1546 gtk_container_foreach(GTK_CONTAINER(menuitem), (GtkCallback)enable_markup, NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1547 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1548 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1549 g_signal_connect(G_OBJECT(font_button), "button-press-event", G_CALLBACK(button_activate_on_click), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1550 g_signal_connect(G_OBJECT(font_button), "activate", G_CALLBACK(pidgin_menu_clicked), font_menu); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1551 g_signal_connect(G_OBJECT(font_menu), "deactivate", G_CALLBACK(pidgin_menu_deactivate), font_button); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1552 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1553 /* Sep */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1554 sep = gtk_vseparator_new(); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1555 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1556 gtk_widget_show_all(sep); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1557 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1558 /* Insert */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1559 insert_button = gtk_toggle_button_new(); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1560 gtk_button_set_relief(GTK_BUTTON(insert_button), GTK_RELIEF_NONE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1561 bbox = gtk_hbox_new(FALSE, 3); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1562 gtk_container_add(GTK_CONTAINER(insert_button), bbox); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1563 image = gtk_image_new_from_stock(PIDGIN_STOCK_TOOLBAR_INSERT, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1564 gtk_box_pack_start(GTK_BOX(bbox), image, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1565 label = gtk_label_new_with_mnemonic(_("_Insert")); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1566 gtk_box_pack_start(GTK_BOX(bbox), label, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1567 gtk_box_pack_start(GTK_BOX(box), insert_button, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1568 gtk_widget_show_all(insert_button); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1569 |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1570 priv->insert_menu = insert_menu = gtk_menu_new(); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1571 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1572 menuitem = gtk_menu_item_new_with_mnemonic(_("_Image")); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1573 g_signal_connect_swapped(G_OBJECT(menuitem), "activate", G_CALLBACK(gtk_button_clicked), priv->image); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1574 gtk_menu_shell_append(GTK_MENU_SHELL(insert_menu), menuitem); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1575 g_signal_connect(G_OBJECT(priv->image), "notify::sensitive", |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1576 G_CALLBACK(button_sensitiveness_changed), menuitem); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1577 g_signal_connect(G_OBJECT(priv->image), "notify::visible", |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1578 G_CALLBACK(button_visibility_changed), menuitem); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1579 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1580 menuitem = gtk_menu_item_new_with_mnemonic(_("_Link")); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1581 g_signal_connect_swapped(G_OBJECT(menuitem), "activate", G_CALLBACK(gtk_button_clicked), priv->link); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1582 gtk_menu_shell_append(GTK_MENU_SHELL(insert_menu), menuitem); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1583 g_signal_connect(G_OBJECT(priv->link), "notify::sensitive", |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1584 G_CALLBACK(button_sensitiveness_changed), menuitem); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1585 g_signal_connect(G_OBJECT(priv->link), "notify::visible", |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1586 G_CALLBACK(button_visibility_changed), menuitem); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1587 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1588 menuitem = gtk_menu_item_new_with_mnemonic(_("_Horizontal rule")); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1589 g_signal_connect(G_OBJECT(menuitem), "activate" , G_CALLBACK(insert_hr_cb), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1590 gtk_menu_shell_append(GTK_MENU_SHELL(insert_menu), menuitem); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1591 priv->insert_hr = menuitem; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1592 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1593 g_signal_connect(G_OBJECT(insert_button), "button-press-event", G_CALLBACK(button_activate_on_click), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1594 g_signal_connect(G_OBJECT(insert_button), "activate", G_CALLBACK(pidgin_menu_clicked), insert_menu); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1595 g_signal_connect(G_OBJECT(insert_menu), "deactivate", G_CALLBACK(pidgin_menu_deactivate), insert_button); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1596 priv->sml = NULL; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1597 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1598 /* Sep */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1599 sep = gtk_vseparator_new(); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1600 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1601 gtk_widget_show_all(sep); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1602 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1603 /* Smiley */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1604 smiley_button = gtk_button_new(); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1605 gtk_button_set_relief(GTK_BUTTON(smiley_button), GTK_RELIEF_NONE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1606 bbox = gtk_hbox_new(FALSE, 3); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1607 gtk_container_add(GTK_CONTAINER(smiley_button), bbox); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1608 image = gtk_image_new_from_stock(PIDGIN_STOCK_TOOLBAR_SMILEY, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1609 gtk_box_pack_start(GTK_BOX(bbox), image, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1610 label = gtk_label_new_with_mnemonic(_("_Smile!")); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1611 gtk_box_pack_start(GTK_BOX(bbox), label, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1612 gtk_box_pack_start(GTK_BOX(box), smiley_button, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1613 g_signal_connect(G_OBJECT(smiley_button), "button-press-event", G_CALLBACK(gtk_webviewtoolbar_popup_menu), toolbar); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1614 g_signal_connect_swapped(G_OBJECT(smiley_button), "clicked", G_CALLBACK(gtk_button_clicked), priv->smiley); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1615 gtk_widget_show_all(smiley_button); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1616 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1617 /* Sep */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1618 sep = gtk_vseparator_new(); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1619 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1620 gtk_widget_show_all(sep); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1621 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1622 /* Attention */ |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1623 attention_button = gtk_button_new(); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1624 gtk_button_set_relief(GTK_BUTTON(attention_button), GTK_RELIEF_NONE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1625 bbox = gtk_hbox_new(FALSE, 3); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1626 gtk_container_add(GTK_CONTAINER(attention_button), bbox); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1627 image = gtk_image_new_from_stock(PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1628 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1629 gtk_box_pack_start(GTK_BOX(bbox), image, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1630 label = gtk_label_new_with_mnemonic(_("_Attention!")); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1631 gtk_box_pack_start(GTK_BOX(bbox), label, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1632 gtk_box_pack_start(GTK_BOX(box), attention_button, FALSE, FALSE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1633 g_signal_connect_swapped(G_OBJECT(attention_button), "clicked", |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1634 G_CALLBACK(gtk_button_clicked), priv->attention); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1635 gtk_widget_show_all(attention_button); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1636 |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1637 g_signal_connect(G_OBJECT(priv->attention), "notify::sensitive", |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1638 G_CALLBACK(button_sensitiveness_changed), attention_button); |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1639 g_signal_connect(G_OBJECT(priv->attention), "notify::visible", |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1640 G_CALLBACK(button_visibility_changed), attention_button); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1641 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1642 /* set attention button to be greyed out until we get a conversation */ |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1643 gtk_widget_set_sensitive(priv->attention, FALSE); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1644 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1645 gtk_box_pack_start(GTK_BOX(hbox), box, FALSE, FALSE, 0); |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1646 priv->lean_view = box; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1647 gtk_widget_show(box); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1648 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1649 purple_prefs_connect_callback(toolbar, PIDGIN_PREFS_ROOT "/conversations/toolbar/wide", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1650 webviewtoolbar_view_pref_changed, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1651 g_signal_connect_data(G_OBJECT(toolbar), "realize", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1652 G_CALLBACK(purple_prefs_trigger_callback), PIDGIN_PREFS_ROOT "/conversations/toolbar/wide", |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1653 NULL, G_CONNECT_AFTER | G_CONNECT_SWAPPED); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1654 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1655 gtk_event_box_set_visible_window(GTK_EVENT_BOX(event), FALSE); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1656 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1657 gtk_widget_add_events(event, GDK_BUTTON_PRESS_MASK); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1658 gtk_box_pack_start(GTK_BOX(hbox), event, TRUE, TRUE, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1659 g_signal_connect(G_OBJECT(event), "button-press-event", G_CALLBACK(gtk_webviewtoolbar_popup_menu), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1660 gtk_widget_show(event); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1661 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1662 |
32460
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1663 /****************************************************************************** |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1664 * Public API |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1665 *****************************************************************************/ |
4cae9a5630e9
Re-arrange things a bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32459
diff
changeset
|
1666 |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1667 GtkWidget * |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1668 gtk_webviewtoolbar_new(void) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1669 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1670 return GTK_WIDGET(g_object_new(gtk_webviewtoolbar_get_type(), NULL)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1671 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1672 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1673 GType |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1674 gtk_webviewtoolbar_get_type(void) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1675 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1676 static GType webviewtoolbar_type = 0; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1677 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1678 if (!webviewtoolbar_type) { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1679 static const GTypeInfo webviewtoolbar_info = { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1680 sizeof(GtkWebViewToolbarClass), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1681 NULL, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1682 NULL, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1683 (GClassInitFunc)gtk_webviewtoolbar_class_init, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1684 NULL, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1685 NULL, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1686 sizeof(GtkWebViewToolbar), |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1687 0, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1688 (GInstanceInitFunc)gtk_webviewtoolbar_init, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1689 NULL |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1690 }; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1691 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1692 webviewtoolbar_type = g_type_register_static(GTK_TYPE_HBOX, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1693 "GtkWebViewToolbar", &webviewtoolbar_info, 0); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1694 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1695 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1696 return webviewtoolbar_type; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1697 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1698 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1699 void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1700 gtk_webviewtoolbar_attach(GtkWebViewToolbar *toolbar, GtkWidget *webview) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1701 { |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1702 GtkWebViewButtons buttons; |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1703 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1704 g_return_if_fail(toolbar != NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1705 g_return_if_fail(GTK_IS_WEBVIEWTOOLBAR(toolbar)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1706 g_return_if_fail(webview != NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1707 g_return_if_fail(GTK_IS_WEBVIEW(webview)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1708 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1709 toolbar->webview = webview; |
32459
64aea8af2831
Update the signals in the GtkWebViewToolbar.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32451
diff
changeset
|
1710 g_signal_connect(G_OBJECT(webview), "allowed-formats-updated", |
64aea8af2831
Update the signals in the GtkWebViewToolbar.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32451
diff
changeset
|
1711 G_CALLBACK(update_buttons_cb), toolbar); |
64aea8af2831
Update the signals in the GtkWebViewToolbar.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32451
diff
changeset
|
1712 g_signal_connect_after(G_OBJECT(webview), "format-toggled", |
64aea8af2831
Update the signals in the GtkWebViewToolbar.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32451
diff
changeset
|
1713 G_CALLBACK(toggle_button_cb), toolbar); |
64aea8af2831
Update the signals in the GtkWebViewToolbar.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32451
diff
changeset
|
1714 g_signal_connect_after(G_OBJECT(webview), "format-cleared", |
64aea8af2831
Update the signals in the GtkWebViewToolbar.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32451
diff
changeset
|
1715 G_CALLBACK(update_format_cb), toolbar); |
64aea8af2831
Update the signals in the GtkWebViewToolbar.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32451
diff
changeset
|
1716 g_signal_connect(G_OBJECT(webview), "format-updated", |
64aea8af2831
Update the signals in the GtkWebViewToolbar.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32451
diff
changeset
|
1717 G_CALLBACK(update_format_cb), toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1718 #if 0 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1719 g_signal_connect_after(G_OBJECT(GTK_WEBVIEW(webview)->text_buffer), "mark-set", G_CALLBACK(mark_set_cb), toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1720 #endif |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1721 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1722 buttons = gtk_webview_get_format_functions(GTK_WEBVIEW(webview)); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1723 update_buttons_cb(GTK_WEBVIEW(webview), buttons, toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1724 update_buttons(toolbar); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1725 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1726 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1727 void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1728 gtk_webviewtoolbar_associate_smileys(GtkWebViewToolbar *toolbar, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1729 const char *proto_id) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1730 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1731 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1732 g_free(priv->sml); |
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1733 priv->sml = g_strdup(proto_id); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1734 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1735 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1736 void |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1737 gtk_webviewtoolbar_switch_active_conversation(GtkWebViewToolbar *toolbar, |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1738 PurpleConversation *conv) |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1739 { |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1740 GtkWebViewToolbarPriv *priv = GTK_WEBVIEWTOOLBAR_GET_PRIVATE(toolbar); |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1741 PurpleConnection *gc = purple_conversation_get_connection(conv); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1742 PurplePlugin *prpl = purple_connection_get_prpl(gc); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1743 |
32464
8ffa03e3b0a2
Use pointers in the private struct instead of g_object_[gs]et_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32463
diff
changeset
|
1744 priv->active_conv = conv; |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1745 |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1746 /* gray out attention button on protocols that don't support it |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1747 for the time being it is always disabled for chats */ |
32462
15fa3f5e2c3f
Move all internal toolbar pointers into a private struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32460
diff
changeset
|
1748 gtk_widget_set_sensitive(priv->attention, |
32451
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1749 conv && prpl && purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM && |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1750 PURPLE_PLUGIN_PROTOCOL_INFO(prpl)->send_attention != NULL); |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1751 } |
a803139fc875
Add a GtkWebViewToolbar. This is basically a copy of the GtkIMHtml
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
1752 |