pidgin/plugins/webkit.c

Sat, 17 Aug 2013 06:01:42 +0530

author
Ankit Vani <a@nevitus.org>
date
Sat, 17 Aug 2013 06:01:42 +0530
branch
soc.2013.gobjectification
changeset 34883
7d9d0d7b7b62
parent 34655
6a939719ea98
parent 34299
419c033e46b9
child 36758
deee438dc431
permissions
-rw-r--r--

Merged default branch

32534
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
1 /*
0fb9ddb72e3e 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.
0fb9ddb72e3e 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>
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
4 *
0fb9ddb72e3e 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
0fb9ddb72e3e 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
0fb9ddb72e3e 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
0fb9ddb72e3e 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.
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
9 *
0fb9ddb72e3e 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,
0fb9ddb72e3e 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
0fb9ddb72e3e 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
0fb9ddb72e3e 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.
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
14 *
0fb9ddb72e3e 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
0fb9ddb72e3e 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
0fb9ddb72e3e 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.
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
18 */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
19
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
20 #include "internal.h"
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
21
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
22 #include "version.h"
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
23
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
24 #include "gtkplugin.h"
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
25
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
26 static gboolean
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
27 plugin_load(PurplePlugin *plugin)
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
28 {
34299
419c033e46b9 Enable WebKit inspector for all widgets, not only conversation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34298
diff changeset
29 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/webview");
419c033e46b9 Enable WebKit inspector for all widgets, not only conversation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34298
diff changeset
30 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/webview/inspector_enabled", FALSE);
32534
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
31
34299
419c033e46b9 Enable WebKit inspector for all widgets, not only conversation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34298
diff changeset
32 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/webview/inspector_enabled", TRUE);
32534
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
33
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
34 return TRUE;
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
35 }
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
36
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
37 static gboolean
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
38 plugin_unload(PurplePlugin *plugin)
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
39 {
34299
419c033e46b9 Enable WebKit inspector for all widgets, not only conversation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34298
diff changeset
40 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/webview/inspector_enabled", FALSE);
32534
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
41
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
42 return TRUE;
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
43 }
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
44
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
45 static PurplePluginInfo info =
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
46 {
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
47 PURPLE_PLUGIN_MAGIC,
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
48 PURPLE_MAJOR_VERSION, /**< major version */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
49 PURPLE_MINOR_VERSION, /**< minor version */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
50 PURPLE_PLUGIN_STANDARD, /**< type */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
51 PIDGIN_PLUGIN_TYPE, /**< ui_requirement */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
52 0, /**< flags */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
53 NULL, /**< dependencies */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
54 PURPLE_PRIORITY_DEFAULT, /**< priority */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
55
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
56 "gtkwebkit-inspect", /**< id */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
57 N_("WebKit Development"), /**< name */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
58 DISPLAY_VERSION, /**< version */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
59 N_("Enables WebKit Inspector."), /**< summary */
34299
419c033e46b9 Enable WebKit inspector for all widgets, not only conversation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34298
diff changeset
60 N_("Enables WebKit's built-in inspector. This "
419c033e46b9 Enable WebKit inspector for all widgets, not only conversation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34298
diff changeset
61 "may be viewed by right-clicking a WebKit "
419c033e46b9 Enable WebKit inspector for all widgets, not only conversation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34298
diff changeset
62 "widget and selecting 'Inspect Element'."), /**< description */
32534
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
63 "Elliott Sales de Andrade <qulogic@pidgin.im>", /**< author */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
64 PURPLE_WEBSITE, /**< homepage */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
65 plugin_load, /**< load */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
66 plugin_unload, /**< unload */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
67 NULL, /**< destroy */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
68 NULL, /**< ui_info */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
69 NULL, /**< extra_info */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
70 NULL, /**< prefs_info */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
71 NULL, /**< actions */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
72
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
73 /* padding */
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
74 NULL,
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
75 NULL,
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
76 NULL,
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
77 NULL
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
78 };
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
79
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
80 static void
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
81 init_plugin(PurplePlugin *plugin)
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
82 {
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
83 }
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
84
0fb9ddb72e3e Add a WebKit Development plugin, that allows opening the builtin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
85 PURPLE_INIT_PLUGIN(webkit-devel, init_plugin, info)

mercurial