annotate pidgin/plugins/webkit.c @ 32619:17c27a527004

Add some boilerplate Conversation theme GObjects. These don't do anything yet, and aren't used either.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 17 Sep 2011 05:27:30 +0000
parents d478be29444a
children afd256914830
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32617
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
1 /*
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
2 * WebKit - Open the inspector on any WebKit views.
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
3 * Copyright (C) 2011 Elliott Sales de Andrade <qulogic@pidgin.im>
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
4 *
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
6 * modify it under the terms of the GNU General Public License
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
7 * as published by the Free Software Foundation; either version 2
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
8 * of the License, or (at your option) any later version.
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
9 *
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
13 * GNU General Public License for more details.
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
14 *
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
16 * along with this program; if not, write to the Free Software
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA.
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
18 */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
19
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
20 #ifdef HAVE_CONFIG_H
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
21 #include <config.h>
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
22 #endif
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
23
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
24 #include "internal.h"
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
25
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
26 #include "version.h"
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
27
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
28 #include "pidgin.h"
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
29
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
30 #include "gtkconv.h"
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
31 #include "gtkplugin.h"
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
32 #include "gtkwebview.h"
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
33
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
34 static WebKitWebView *
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
35 create_gtk_window_around_it(WebKitWebInspector *inspector,
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
36 WebKitWebView *webview,
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
37 PidginConversation *gtkconv)
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
38 {
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
39 GtkWidget *win;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
40 GtkWidget *view;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
41 char *title;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
42
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
43 win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
44 title = g_strdup_printf(_("%s - Inspector"),
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
45 gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)));
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
46 gtk_window_set_title(GTK_WINDOW(win), title);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
47 g_free(title);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
48 gtk_window_set_default_size(GTK_WINDOW(win), 600, 400);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
49
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
50 view = webkit_web_view_new();
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
51 gtk_container_add(GTK_CONTAINER(win), view);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
52 g_object_set_data(G_OBJECT(webview), "inspector-window", win);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
53
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
54 return WEBKIT_WEB_VIEW(view);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
55 }
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
56
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
57 static gboolean
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
58 show_inspector_window(WebKitWebInspector *inspector,
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
59 GtkWidget *webview)
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
60 {
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
61 GtkWidget *win;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
62
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
63 win = g_object_get_data(G_OBJECT(webview), "inspector-window");
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
64
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
65 gtk_widget_show_all(win);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
66
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
67 return TRUE;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
68 }
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
69
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
70 static void
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
71 setup_inspector(PidginConversation *gtkconv)
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
72 {
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
73 GtkWidget *webview = gtkconv->webview;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
74 WebKitWebSettings *settings;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
75 WebKitWebInspector *inspector;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
76
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
77 settings = webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webview));
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
78 inspector = webkit_web_view_get_inspector(WEBKIT_WEB_VIEW(webview));
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
79
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
80 g_object_set(G_OBJECT(settings), "enable-developer-extras", TRUE, NULL);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
81
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
82 g_signal_connect(G_OBJECT(inspector), "inspect-web-view",
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
83 G_CALLBACK(create_gtk_window_around_it), gtkconv);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
84 g_signal_connect(G_OBJECT(inspector), "show-window",
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
85 G_CALLBACK(show_inspector_window), webview);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
86 }
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
87
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
88 static void
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
89 remove_inspector(PidginConversation *gtkconv)
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
90 {
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
91 GtkWidget *webview = gtkconv->webview;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
92 GtkWidget *win;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
93 WebKitWebSettings *settings;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
94 WebKitWebInspector *inspector;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
95
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
96 win = g_object_get_data(G_OBJECT(webview), "inspector-window");
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
97 gtk_widget_destroy(win);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
98 g_object_set_data(G_OBJECT(webview), "inspector-window", NULL);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
99
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
100 settings = webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webview));
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
101 inspector = webkit_web_view_get_inspector(WEBKIT_WEB_VIEW(webview));
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
102
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
103 g_object_set(G_OBJECT(settings), "enable-developer-extras", FALSE, NULL);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
104 }
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
105
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
106 static void
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
107 conversation_displayed_cb(PidginConversation *gtkconv)
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
108 {
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
109 GtkWidget *inspect = NULL;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
110
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
111 inspect = g_object_get_data(G_OBJECT(gtkconv->webview),
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
112 "inspector-window");
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
113 if (inspect == NULL) {
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
114 setup_inspector(gtkconv);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
115 }
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
116 }
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
117
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
118 static gboolean
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
119 plugin_load(PurplePlugin *plugin)
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
120 {
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
121 GList *convs = purple_get_conversations();
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
122 void *gtk_conv_handle = pidgin_conversations_get_handle();
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
123
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
124 purple_signal_connect(gtk_conv_handle, "conversation-displayed", plugin,
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
125 PURPLE_CALLBACK(conversation_displayed_cb), NULL);
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
126
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
127 while (convs) {
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
128 PurpleConversation *conv = (PurpleConversation *)convs->data;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
129
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
130 /* Setup WebKit Inspector */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
131 if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) {
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
132 setup_inspector(PIDGIN_CONVERSATION(conv));
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
133 }
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
134
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
135 convs = convs->next;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
136 }
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
137
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
138 return TRUE;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
139 }
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
140
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
141 static gboolean
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
142 plugin_unload(PurplePlugin *plugin)
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
143 {
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
144 GList *convs = purple_get_conversations();
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
145
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
146 while (convs) {
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
147 PurpleConversation *conv = (PurpleConversation *)convs->data;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
148
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
149 /* Remove WebKit Inspector */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
150 if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) {
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
151 remove_inspector(PIDGIN_CONVERSATION(conv));
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
152 }
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
153
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
154 convs = convs->next;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
155 }
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
156
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
157 return TRUE;
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
158 }
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
159
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
160 static PurplePluginInfo info =
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
161 {
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
162 PURPLE_PLUGIN_MAGIC,
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
163 PURPLE_MAJOR_VERSION, /**< major version */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
164 PURPLE_MINOR_VERSION, /**< minor version */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
165 PURPLE_PLUGIN_STANDARD, /**< type */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
166 PIDGIN_PLUGIN_TYPE, /**< ui_requirement */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
167 0, /**< flags */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
168 NULL, /**< dependencies */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
169 PURPLE_PRIORITY_DEFAULT, /**< priority */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
170
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
171 "gtkwebkit-inspect", /**< id */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
172 N_("WebKit Development"), /**< name */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
173 DISPLAY_VERSION, /**< version */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
174 N_("Enables WebKit Inspector."), /**< summary */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
175 N_("Enables WebKit's built-in inspector in a "
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
176 "conversation window. This may be viewed "
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
177 "by right-clicking a WebKit widget and "
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
178 "selecting 'Inspect Element'."), /**< description */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
179 "Elliott Sales de Andrade <qulogic@pidgin.im>", /**< author */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
180 PURPLE_WEBSITE, /**< homepage */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
181 plugin_load, /**< load */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
182 plugin_unload, /**< unload */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
183 NULL, /**< destroy */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
184 NULL, /**< ui_info */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
185 NULL, /**< extra_info */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
186 NULL, /**< prefs_info */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
187 NULL, /**< actions */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
188
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
189 /* padding */
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
190 NULL,
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
191 NULL,
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
192 NULL,
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
193 NULL
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
194 };
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
195
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
196 static void
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
197 init_plugin(PurplePlugin *plugin)
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
198 {
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
199 }
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
200
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
201 PURPLE_INIT_PLUGIN(webkit-devel, init_plugin, info)
d478be29444a Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
202