Merge lp:~noskcaj/ubuntu/wily/epiphany-browser/merge2 into lp:ubuntu/wily/epiphany-browser

Proposed by Jackson Doak
Status: Merged
Merge reported by: Robert Ancell
Merged at revision: not available
Proposed branch: lp:~noskcaj/ubuntu/wily/epiphany-browser/merge2
Merge into: lp:ubuntu/wily/epiphany-browser
Diff against target: 12870 lines (+1091/-6067)
41 files modified
.pc/00_epiphany-browser.patch/configure.ac (+0/-261)
.pc/07_bookmarks.patch/data/default-bookmarks.rdf.in (+0/-37)
.pc/12_safetypes.patch/data/mime-types-permissions.xml (+0/-482)
.pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks/ephy-bookmarks-ui.c (+0/-363)
.pc/applied-patches (+0/-5)
.pc/ubuntu_titlebars.patch/src/ephy-window.c (+0/-4026)
ChangeLog (+70/-0)
Makefile.in (+6/-2)
NEWS (+8/-0)
aclocal.m4 (+6/-841)
configure (+11/-11)
configure.ac (+1/-1)
data/Makefile.in (+6/-2)
data/pages/Makefile.in (+6/-2)
debian/changelog (+21/-0)
debian/control (+1/-1)
debian/patches/00_epiphany-browser.patch (+4/-4)
doc/Makefile.in (+6/-2)
embed/Makefile.in (+6/-2)
embed/ephy-embed-utils.c (+17/-3)
embed/ephy-web-view.c (+12/-0)
embed/web-extension/Makefile.in (+6/-2)
embed/web-extension/ephy-web-extension.c (+2/-0)
help/Makefile.in (+6/-2)
lib/Makefile.in (+6/-2)
lib/egg/Makefile.in (+6/-2)
lib/history/Makefile.in (+6/-2)
lib/widgets/Makefile.in (+6/-2)
m4/ax_check_enable_debug.m4 (+113/-0)
m4/ax_code_coverage.m4 (+180/-0)
m4/gsettings.m4 (+83/-0)
m4/nls.m4 (+32/-0)
m4/pkg.m4 (+214/-0)
m4/yelp.m4 (+213/-0)
src/Makefile.in (+6/-2)
src/bookmarks/Makefile.in (+6/-2)
src/ephy-search-provider-main.c (+11/-0)
src/ephy-shell-search-provider-generated.c (+1/-1)
src/ephy-shell-search-provider-generated.h (+1/-1)
tests/Makefile.in (+6/-2)
tests/data/Makefile.in (+6/-2)
To merge this branch: bzr merge lp:~noskcaj/ubuntu/wily/epiphany-browser/merge2
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+264481@code.launchpad.net

Description of the change

Merge from debian

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :

This already seems to have been done.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory '.pc/00_epiphany-browser.patch'
=== removed directory '.pc/00_epiphany-browser.patch'
=== added file '.pc/00_epiphany-browser.patch/.timestamp'
=== added file '.pc/00_epiphany-browser.patch/configure.ac'
--- .pc/00_epiphany-browser.patch/configure.ac 1970-01-01 00:00:00 +0000
+++ .pc/00_epiphany-browser.patch/configure.ac 2015-07-11 21:08:34 +0000
@@ -0,0 +1,261 @@
1# Copyright © 2000-2004 Marco Pesenti Gritti
2# Copyright © 2003, 2004, 2005, 2006, 2007 Christian Persch
3#
4# This program is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by the
6# Free Software Foundation; either version 2 of the License, or (at your
7# option) any later version.
8#
9# This program is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12# General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program; if not, write to the Free Software Foundation, Inc.,
16# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
18m4_define([epiphany_version_major],[3])
19m4_define([epiphany_version_minor],[16])
20m4_define([epiphany_version_micro],[3])
21m4_define([epiphany_version],[epiphany_version_major.epiphany_version_minor.epiphany_version_micro])
22
23AC_INIT([GNOME Web Browser],[epiphany_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=epiphany],[epiphany])
24
25AC_PREREQ([2.59])
26
27AC_CONFIG_MACRO_DIR([m4])
28AC_CONFIG_HEADERS([config.h])
29AC_CONFIG_SRCDIR([configure.ac])
30
31AC_SUBST([EPIPHANY_MAJOR],[epiphany_version_major.epiphany_version_minor])
32
33# for EPHY_CHECK_VERSION
34AC_SUBST([EPIPHANY_MAJOR_VERSION], [epiphany_version_major])
35AC_SUBST([EPIPHANY_MINOR_VERSION], [epiphany_version_minor])
36AC_SUBST([EPIPHANY_MICRO_VERSION], [epiphany_version_micro])
37
38AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip tar-ustar])
39
40# Use AM_SILENT_RULES if present
41m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
42
43AM_MAINTAINER_MODE([enable])
44
45# Initialize libtool
46LT_PREREQ(2.2)
47LT_INIT([dlopen disable-static])
48
49AC_PROG_CC
50
51AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
52AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
53
54IT_PROG_INTLTOOL([0.50.0])
55
56GLIB_GSETTINGS
57
58PKG_PROG_PKG_CONFIG
59
60GNOME_DEBUG_CHECK
61GNOME_COMPILE_WARNINGS([maximum])
62GNOME_MAINTAINER_MODE_DEFINES
63
64GNOME_CODE_COVERAGE
65
66WARN_CFLAGS="$WARN_CFLAGS -Wdeclaration-after-statement -Wno-deprecated-declarations -Wno-missing-prototypes"
67
68GLIB_REQUIRED=2.38.0
69GTK_REQUIRED=3.13.0
70LIBXML_REQUIRED=2.6.12
71LIBXSLT_REQUIRED=1.1.7
72WEBKIT_GTK_REQUIRED=2.7.4
73LIBSOUP_REQUIRED=2.48.0
74GNOME_DESKTOP_REQUIRED=2.91.2
75LIBSECRET_REQUIRED=0.14
76GSETTINGS_DESKTOP_SCHEMAS_REQUIRED=0.0.1
77LIBNOTIFY_REQUIRED=0.5.1
78GCR_REQUIRED=3.5.5
79AVAHI_REQUIRED=0.6.22
80
81# Tests
82
83AC_MSG_CHECKING([whether to build tests])
84AC_ARG_ENABLE([tests],
85 AS_HELP_STRING([--enable-tests],[Whether to build tests (default: yes)]),
86 [], [enable_tests=yes])
87AC_MSG_RESULT([$enable_tests])
88
89AM_CONDITIONAL([ENABLE_TESTS],[test "$enable_tests" = "yes"])
90
91PKG_CHECK_MODULES([DEPENDENCIES], [
92 glib-2.0 >= $GLIB_REQUIRED
93 gthread-2.0
94 gio-unix-2.0 >= $GLIB_REQUIRED
95 gtk+-3.0 >= $GTK_REQUIRED
96 gtk+-unix-print-3.0 >= $GTK_REQUIRED
97 x11
98 libwnck-3.0
99 libxml-2.0 >= $LIBXML_REQUIRED
100 libxslt >= $LIBXSLT_REQUIRED
101 webkit2gtk-4.0 >= $WEBKIT_GTK_REQUIRED
102 libsoup-2.4 >= $LIBSOUP_REQUIRED
103 libsecret-1 >= $LIBSECRET_REQUIRED
104 gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED
105 gsettings-desktop-schemas >= $GSETTINGS_DESKTOP_SCHEMAS_REQUIRED
106 libnotify >= $LIBNOTIFY_REQUIRED
107 sqlite3
108 gcr-3 >= $GCR_REQUIRED
109 avahi-gobject >= $AVAHI_REQUIRED
110 avahi-client >= $AVAHI_REQUIRED
111 ])
112
113PKG_CHECK_MODULES(WEB_EXTENSION, [
114 webkit2gtk-web-extension-4.0 >= $WEBKIT_GTK_REQUIRED
115 libsecret-1 >= $LIBSECRET_REQUIRED
116 ])
117AC_SUBST(WEB_EXTENSION_CFLAGS)
118AC_SUBST(WEB_EXTENSION_LIBS)
119
120# ******************
121# Portability checks
122# ******************
123
124AC_CHECK_FUNCS([localtime_r memchr memmove memset mkdir mkdtemp realpath sqrt strchr strcspn strdup strerror strrchr strtol strtoul strstr])
125
126# for backtrace()
127AC_CHECK_HEADERS([execinfo.h fcntl.h])
128AC_SEARCH_LIBS([backtrace], [c execinfo])
129AC_C_INLINE
130AC_FUNC_MKTIME
131AC_FUNC_STRTOD
132AC_TYPE_SIZE_T
133
134# ***************
135# Multimedia keys
136# ***************
137
138AC_CHECK_HEADERS([X11/XF86keysym.h])
139
140# ***
141# NSS
142# ***
143
144AC_MSG_CHECKING([whether NSS support is requested])
145AC_ARG_ENABLE([nss],
146 [AS_HELP_STRING([--enable-nss], [Enable NSS support (default: enabled)])],
147 [], [enable_nss=yes])
148AC_MSG_RESULT([$enable_nss])
149
150if test "$enable_nss" = "yes"; then
151 PKG_CHECK_MODULES([NSS], [nss])
152
153 AC_DEFINE([ENABLE_NSS], [1], [Define to compile with NSS support])
154fi
155
156AM_CONDITIONAL([ENABLE_NSS],[test "$enable_nss" = "yes"])
157
158# *******************************
159# Internationalization
160# *******************************
161
162ISO_CODES_REQUIRED=0.35
163
164PKG_CHECK_EXISTS([iso-codes >= $ISO_CODES_REQUIRED],
165 [have_iso_codes=yes],[have_iso_codes=no])
166
167if test "$have_iso_codes" = "yes"; then
168 AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
169 if $PKG_CONFIG --variable=domains iso-codes | grep -q 639 && \
170 $PKG_CONFIG --variable=domains iso-codes | grep -q 3166 ; then
171 result=yes
172 else
173 result=no
174 have_iso_codes=no
175 fi
176 AC_MSG_RESULT([$result])
177fi
178
179if test "$have_iso_codes" = "yes"; then
180 AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
181 AC_DEFINE([HAVE_ISO_CODES],[1],[Define if you have the iso-codes package])
182else
183 AC_MSG_ERROR([iso-codes is required])
184fi
185
186GETTEXT_PACKAGE=epiphany
187AC_SUBST([GETTEXT_PACKAGE])
188AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
189AM_GLIB_GNU_GETTEXT
190
191# *******************************
192# User help
193# *******************************
194
195YELP_HELP_INIT
196
197# ****************
198# Distributor name
199# ****************
200
201AC_ARG_WITH([distributor-name],
202 AS_HELP_STRING([--with-distributor-name=name],[Set the distributor name]),
203 [LSB_DISTRIBUTOR="$withval"])
204
205if test -z "$LSB_DISTRIBUTOR"; then
206 AC_CHECK_PROGS([LSB_RELEASE], [lsb_release],)
207 if test -n "$LSB_RELEASE"; then
208 # Fallback on lsb_release if available
209 LSB_DISTRIBUTOR=$($LSB_RELEASE -i -s)
210 else
211 # Fallback on the product name
212 LSB_DISTRIBUTOR="Epiphany"
213 fi
214fi
215
216AC_DEFINE_UNQUOTED([LSB_DISTRIBUTOR],["$LSB_DISTRIBUTOR"],[Distributor name])
217
218# ************
219# Output files
220# ************
221
222AC_DEFINE([EPIPHANY_COMPILATION],[1],[Compiling epiphany])
223
224AC_CONFIG_FILES([
225Makefile
226data/Makefile
227data/epiphany.desktop.in
228data/pages/Makefile
229doc/Makefile
230help/Makefile
231lib/Makefile
232lib/egg/Makefile
233lib/history/Makefile
234lib/widgets/Makefile
235embed/Makefile
236embed/web-extension/Makefile
237src/Makefile
238src/bookmarks/Makefile
239po/Makefile.in
240tests/Makefile
241tests/data/Makefile
242],
243[])
244
245AC_OUTPUT
246
247# *************************************
248# *************************************
249
250echo "
251Epiphany was configured with the following options:
252
253 Source code location : $srcdir
254 Compiler : $CC
255 Prefix : $prefix
256 Extra debugging support : $enable_debug
257 Build tests : $enable_tests
258 Code coverage : $enable_code_coverage
259
260 NSS support : $enable_nss
261"
0262
=== removed file '.pc/00_epiphany-browser.patch/configure.ac'
--- .pc/00_epiphany-browser.patch/configure.ac 2015-06-25 06:50:45 +0000
+++ .pc/00_epiphany-browser.patch/configure.ac 1970-01-01 00:00:00 +0000
@@ -1,261 +0,0 @@
1# Copyright © 2000-2004 Marco Pesenti Gritti
2# Copyright © 2003, 2004, 2005, 2006, 2007 Christian Persch
3#
4# This program is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by the
6# Free Software Foundation; either version 2 of the License, or (at your
7# option) any later version.
8#
9# This program is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12# General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program; if not, write to the Free Software Foundation, Inc.,
16# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
18m4_define([epiphany_version_major],[3])
19m4_define([epiphany_version_minor],[16])
20m4_define([epiphany_version_micro],[2])
21m4_define([epiphany_version],[epiphany_version_major.epiphany_version_minor.epiphany_version_micro])
22
23AC_INIT([GNOME Web Browser],[epiphany_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=epiphany],[epiphany])
24
25AC_PREREQ([2.59])
26
27AC_CONFIG_MACRO_DIR([m4])
28AC_CONFIG_HEADERS([config.h])
29AC_CONFIG_SRCDIR([configure.ac])
30
31AC_SUBST([EPIPHANY_MAJOR],[epiphany_version_major.epiphany_version_minor])
32
33# for EPHY_CHECK_VERSION
34AC_SUBST([EPIPHANY_MAJOR_VERSION], [epiphany_version_major])
35AC_SUBST([EPIPHANY_MINOR_VERSION], [epiphany_version_minor])
36AC_SUBST([EPIPHANY_MICRO_VERSION], [epiphany_version_micro])
37
38AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip tar-ustar])
39
40# Use AM_SILENT_RULES if present
41m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
42
43AM_MAINTAINER_MODE([enable])
44
45# Initialize libtool
46LT_PREREQ(2.2)
47LT_INIT([dlopen disable-static])
48
49AC_PROG_CC
50
51AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
52AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
53
54IT_PROG_INTLTOOL([0.50.0])
55
56GLIB_GSETTINGS
57
58PKG_PROG_PKG_CONFIG
59
60GNOME_DEBUG_CHECK
61GNOME_COMPILE_WARNINGS([maximum])
62GNOME_MAINTAINER_MODE_DEFINES
63
64GNOME_CODE_COVERAGE
65
66WARN_CFLAGS="$WARN_CFLAGS -Wdeclaration-after-statement -Wno-deprecated-declarations -Wno-missing-prototypes"
67
68GLIB_REQUIRED=2.38.0
69GTK_REQUIRED=3.13.0
70LIBXML_REQUIRED=2.6.12
71LIBXSLT_REQUIRED=1.1.7
72WEBKIT_GTK_REQUIRED=2.7.4
73LIBSOUP_REQUIRED=2.48.0
74GNOME_DESKTOP_REQUIRED=2.91.2
75LIBSECRET_REQUIRED=0.14
76GSETTINGS_DESKTOP_SCHEMAS_REQUIRED=0.0.1
77LIBNOTIFY_REQUIRED=0.5.1
78GCR_REQUIRED=3.5.5
79AVAHI_REQUIRED=0.6.22
80
81# Tests
82
83AC_MSG_CHECKING([whether to build tests])
84AC_ARG_ENABLE([tests],
85 AS_HELP_STRING([--enable-tests],[Whether to build tests (default: yes)]),
86 [], [enable_tests=yes])
87AC_MSG_RESULT([$enable_tests])
88
89AM_CONDITIONAL([ENABLE_TESTS],[test "$enable_tests" = "yes"])
90
91PKG_CHECK_MODULES([DEPENDENCIES], [
92 glib-2.0 >= $GLIB_REQUIRED
93 gthread-2.0
94 gio-unix-2.0 >= $GLIB_REQUIRED
95 gtk+-3.0 >= $GTK_REQUIRED
96 gtk+-unix-print-3.0 >= $GTK_REQUIRED
97 x11
98 libwnck-3.0
99 libxml-2.0 >= $LIBXML_REQUIRED
100 libxslt >= $LIBXSLT_REQUIRED
101 webkit2gtk-4.0 >= $WEBKIT_GTK_REQUIRED
102 libsoup-2.4 >= $LIBSOUP_REQUIRED
103 libsecret-1 >= $LIBSECRET_REQUIRED
104 gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED
105 gsettings-desktop-schemas >= $GSETTINGS_DESKTOP_SCHEMAS_REQUIRED
106 libnotify >= $LIBNOTIFY_REQUIRED
107 sqlite3
108 gcr-3 >= $GCR_REQUIRED
109 avahi-gobject >= $AVAHI_REQUIRED
110 avahi-client >= $AVAHI_REQUIRED
111 ])
112
113PKG_CHECK_MODULES(WEB_EXTENSION, [
114 webkit2gtk-web-extension-4.0 >= $WEBKIT_GTK_REQUIRED
115 libsecret-1 >= $LIBSECRET_REQUIRED
116 ])
117AC_SUBST(WEB_EXTENSION_CFLAGS)
118AC_SUBST(WEB_EXTENSION_LIBS)
119
120# ******************
121# Portability checks
122# ******************
123
124AC_CHECK_FUNCS([localtime_r memchr memmove memset mkdir mkdtemp realpath sqrt strchr strcspn strdup strerror strrchr strtol strtoul strstr])
125
126# for backtrace()
127AC_CHECK_HEADERS([execinfo.h fcntl.h])
128AC_SEARCH_LIBS([backtrace], [c execinfo])
129AC_C_INLINE
130AC_FUNC_MKTIME
131AC_FUNC_STRTOD
132AC_TYPE_SIZE_T
133
134# ***************
135# Multimedia keys
136# ***************
137
138AC_CHECK_HEADERS([X11/XF86keysym.h])
139
140# ***
141# NSS
142# ***
143
144AC_MSG_CHECKING([whether NSS support is requested])
145AC_ARG_ENABLE([nss],
146 [AS_HELP_STRING([--enable-nss], [Enable NSS support (default: enabled)])],
147 [], [enable_nss=yes])
148AC_MSG_RESULT([$enable_nss])
149
150if test "$enable_nss" = "yes"; then
151 PKG_CHECK_MODULES([NSS], [nss])
152
153 AC_DEFINE([ENABLE_NSS], [1], [Define to compile with NSS support])
154fi
155
156AM_CONDITIONAL([ENABLE_NSS],[test "$enable_nss" = "yes"])
157
158# *******************************
159# Internationalization
160# *******************************
161
162ISO_CODES_REQUIRED=0.35
163
164PKG_CHECK_EXISTS([iso-codes >= $ISO_CODES_REQUIRED],
165 [have_iso_codes=yes],[have_iso_codes=no])
166
167if test "$have_iso_codes" = "yes"; then
168 AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
169 if $PKG_CONFIG --variable=domains iso-codes | grep -q 639 && \
170 $PKG_CONFIG --variable=domains iso-codes | grep -q 3166 ; then
171 result=yes
172 else
173 result=no
174 have_iso_codes=no
175 fi
176 AC_MSG_RESULT([$result])
177fi
178
179if test "$have_iso_codes" = "yes"; then
180 AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
181 AC_DEFINE([HAVE_ISO_CODES],[1],[Define if you have the iso-codes package])
182else
183 AC_MSG_ERROR([iso-codes is required])
184fi
185
186GETTEXT_PACKAGE=epiphany
187AC_SUBST([GETTEXT_PACKAGE])
188AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
189AM_GLIB_GNU_GETTEXT
190
191# *******************************
192# User help
193# *******************************
194
195YELP_HELP_INIT
196
197# ****************
198# Distributor name
199# ****************
200
201AC_ARG_WITH([distributor-name],
202 AS_HELP_STRING([--with-distributor-name=name],[Set the distributor name]),
203 [LSB_DISTRIBUTOR="$withval"])
204
205if test -z "$LSB_DISTRIBUTOR"; then
206 AC_CHECK_PROGS([LSB_RELEASE], [lsb_release],)
207 if test -n "$LSB_RELEASE"; then
208 # Fallback on lsb_release if available
209 LSB_DISTRIBUTOR=$($LSB_RELEASE -i -s)
210 else
211 # Fallback on the product name
212 LSB_DISTRIBUTOR="Epiphany"
213 fi
214fi
215
216AC_DEFINE_UNQUOTED([LSB_DISTRIBUTOR],["$LSB_DISTRIBUTOR"],[Distributor name])
217
218# ************
219# Output files
220# ************
221
222AC_DEFINE([EPIPHANY_COMPILATION],[1],[Compiling epiphany])
223
224AC_CONFIG_FILES([
225Makefile
226data/Makefile
227data/epiphany.desktop.in
228data/pages/Makefile
229doc/Makefile
230help/Makefile
231lib/Makefile
232lib/egg/Makefile
233lib/history/Makefile
234lib/widgets/Makefile
235embed/Makefile
236embed/web-extension/Makefile
237src/Makefile
238src/bookmarks/Makefile
239po/Makefile.in
240tests/Makefile
241tests/data/Makefile
242],
243[])
244
245AC_OUTPUT
246
247# *************************************
248# *************************************
249
250echo "
251Epiphany was configured with the following options:
252
253 Source code location : $srcdir
254 Compiler : $CC
255 Prefix : $prefix
256 Extra debugging support : $enable_debug
257 Build tests : $enable_tests
258 Code coverage : $enable_code_coverage
259
260 NSS support : $enable_nss
261"
2620
=== added directory '.pc/07_bookmarks.patch'
=== removed directory '.pc/07_bookmarks.patch'
=== added file '.pc/07_bookmarks.patch/.timestamp'
=== added directory '.pc/07_bookmarks.patch/data'
=== removed directory '.pc/07_bookmarks.patch/data'
=== added file '.pc/07_bookmarks.patch/data/default-bookmarks.rdf.in'
--- .pc/07_bookmarks.patch/data/default-bookmarks.rdf.in 1970-01-01 00:00:00 +0000
+++ .pc/07_bookmarks.patch/data/default-bookmarks.rdf.in 2015-07-11 21:08:34 +0000
@@ -0,0 +1,37 @@
1<?xml version="1.0"?>
2<rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ephy="http://gnome.org/ns/epiphany#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
3 <channel rdf:about="file://@pkgdatadir@/default-bookmarks.rdf">
4 <title>Web bookmarks</title>
5 <link>https://wiki.gnome.org/Apps/Web</link>
6 <items>
7 <rdf:Seq>
8 <rdf:li rdf:resource="https://duckduckgo.com"/>
9 </rdf:Seq>
10 </items>
11 </channel>
12 <item rdf:about="https://duckduckgo.com">
13 <_title>Search the web</_title>
14 <!-- Translators: you can use the regions listed in
15 https://duckduckgo.com/params to boost a particular region
16 associated with your language. For instance, for translators
17 to Finnish, it might make sense to add kl=fi-fi to the search
18 URL in order to boost results from Finland. Additionally, the
19 'kad' parameter can be used to specify the locale in which
20 duckduckgo must be translated. So, for a Finnish localized
21 version of duckduckgo that will render results tailored for
22 Finland, the string would be:
23 https://duckduckgo.com/?t=epiphany&amp;kl=fi-fi&amp;kad=fi_FI
24 -->
25 <_link>https://duckduckgo.com/?t=epiphany</_link>
26 <!-- Translators: you can use the regions listed in
27 https://duckduckgo.com/params to boost a particular region
28 associated with your language. For instance, for translators
29 to Finnish, it might make sense to add kl=fi-fi to the search
30 URL in order to boost results from Finland. Additionally, the
31 'kad' parameter can be used to specify the locale in which
32 duckduckgo must be translated. For such case, the search url
33 would be
34 https://duckduckgo.com/?q=%s&amp;t=epiphany&amp;kl=fi-fi&amp;kad=fi_FI -->
35 <_ephy:smartlink>https://duckduckgo.com/?q=%s&amp;t=epiphany</_ephy:smartlink>
36 </item>
37</rdf:RDF>
038
=== removed file '.pc/07_bookmarks.patch/data/default-bookmarks.rdf.in'
--- .pc/07_bookmarks.patch/data/default-bookmarks.rdf.in 2014-04-11 23:16:25 +0000
+++ .pc/07_bookmarks.patch/data/default-bookmarks.rdf.in 1970-01-01 00:00:00 +0000
@@ -1,37 +0,0 @@
1<?xml version="1.0"?>
2<rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ephy="http://gnome.org/ns/epiphany#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
3 <channel rdf:about="file://@pkgdatadir@/default-bookmarks.rdf">
4 <title>Web bookmarks</title>
5 <link>https://wiki.gnome.org/Apps/Web</link>
6 <items>
7 <rdf:Seq>
8 <rdf:li rdf:resource="https://duckduckgo.com"/>
9 </rdf:Seq>
10 </items>
11 </channel>
12 <item rdf:about="https://duckduckgo.com">
13 <_title>Search the web</_title>
14 <!-- Translators: you can use the regions listed in
15 https://duckduckgo.com/params to boost a particular region
16 associated with your language. For instance, for translators
17 to Finnish, it might make sense to add kl=fi-fi to the search
18 URL in order to boost results from Finland. Additionally, the
19 'kad' parameter can be used to specify the locale in which
20 duckduckgo must be translated. So, for a Finnish localized
21 version of duckduckgo that will render results tailored for
22 Finland, the string would be:
23 https://duckduckgo.com/?t=epiphany&amp;kl=fi-fi&amp;kad=fi_FI
24 -->
25 <_link>https://duckduckgo.com/?t=epiphany</_link>
26 <!-- Translators: you can use the regions listed in
27 https://duckduckgo.com/params to boost a particular region
28 associated with your language. For instance, for translators
29 to Finnish, it might make sense to add kl=fi-fi to the search
30 URL in order to boost results from Finland. Additionally, the
31 'kad' parameter can be used to specify the locale in which
32 duckduckgo must be translated. For such case, the search url
33 would be
34 https://duckduckgo.com/?q=%s&amp;t=epiphany&amp;kl=fi-fi&amp;kad=fi_FI -->
35 <_ephy:smartlink>https://duckduckgo.com/?q=%s&amp;t=epiphany</_ephy:smartlink>
36 </item>
37</rdf:RDF>
380
=== added directory '.pc/12_safetypes.patch'
=== removed directory '.pc/12_safetypes.patch'
=== added file '.pc/12_safetypes.patch/.timestamp'
=== added directory '.pc/12_safetypes.patch/data'
=== removed directory '.pc/12_safetypes.patch/data'
=== added file '.pc/12_safetypes.patch/data/mime-types-permissions.xml'
--- .pc/12_safetypes.patch/data/mime-types-permissions.xml 1970-01-01 00:00:00 +0000
+++ .pc/12_safetypes.patch/data/mime-types-permissions.xml 2015-07-11 21:08:34 +0000
@@ -0,0 +1,482 @@
1<mime-types-permissions>
2<safe>
3<mime-type type="application/andrew-inset"/>
4<mime-type type="application/dicom"/>
5<mime-type type="application/illustrator"/>
6<mime-type type="application/mathematica"/>
7<mime-type type="application/msexcel"/>
8<mime-type type="application/msword"/>
9<mime-type type="application/octet-stream"/>
10<mime-type type="application/oda"/>
11<mime-type type="application/ogg"/>
12<mime-type type="application/pdf"/>
13<mime-type type="application/pgp"/>
14<mime-type type="application/pgp-encrypted"/>
15<mime-type type="application/pgp-keys"/>
16<mime-type type="application/pgp-signature"/>
17<mime-type type="application/pkcs7-mime"/>
18<mime-type type="application/pkcs7-signature"/>
19<mime-type type="application/postscript"/>
20<mime-type type="application/ram"/>
21<mime-type type="application/rdf+xml"/>
22<mime-type type="application/rtf"/>
23<mime-type type="application/sdp"/>
24<mime-type type="application/smil"/>
25<mime-type type="application/stuffit"/>
26<mime-type type="application/vlc"/>
27<mime-type type="application/vnd.corel-draw"/>
28<mime-type type="application/vnd.emusic-emusic_package"/>
29<mime-type type="application/vnd.lotus-1-2-3"/>
30<mime-type type="application/vnd.ms-excel"/>
31<mime-type type="application/vnd.ms-powerpoint"/>
32<mime-type type="application/vnd.ms-word"/>
33<mime-type type="application/vnd.oasis.opendocument.text"/>
34<mime-type type="application/vnd.oasis.opendocument.text-template"/>
35<mime-type type="application/vnd.oasis.opendocument.text-web"/>
36<mime-type type="application/vnd.oasis.opendocument.text-master"/>
37<mime-type type="application/vnd.oasis.opendocument.graphics"/>
38<mime-type type="application/vnd.oasis.opendocument.graphics-template"/>
39<mime-type type="application/vnd.oasis.opendocument.presentation"/>
40<mime-type type="application/vnd.oasis.opendocument.presentation-template"/>
41<mime-type type="application/vnd.oasis.opendocument.spreadsheet"/>
42<mime-type type="application/vnd.oasis.opendocument.spreadsheet-template"/>
43<mime-type type="application/vnd.oasis.opendocument.chart"/>
44<mime-type type="application/vnd.oasis.opendocument.formula"/>
45<mime-type type="application/vnd.oasis.opendocument.database"/>
46<mime-type type="application/vnd.oasis.opendocument.image"/>
47<mime-type type="application/vnd.rn-realmedia"/>
48<mime-type type="application/vnd.stardivision.calc"/>
49<mime-type type="application/vnd.stardivision.chart"/>
50<mime-type type="application/vnd.stardivision.draw"/>
51<mime-type type="application/vnd.stardivision.impress"/>
52<mime-type type="application/vnd.stardivision.mail"/>
53<mime-type type="application/vnd.stardivision.math"/>
54<mime-type type="application/vnd.stardivision.writer"/>
55<mime-type type="application/vnd.sun.xml.calc"/>
56<mime-type type="application/vnd.sun.xml.calc.template"/>
57<mime-type type="application/vnd.sun.xml.draw"/>
58<mime-type type="application/vnd.sun.xml.draw.template"/>
59<mime-type type="application/vnd.sun.xml.impress"/>
60<mime-type type="application/vnd.sun.xml.impress.template"/>
61<mime-type type="application/vnd.sun.xml.math"/>
62<mime-type type="application/vnd.sun.xml.writer"/>
63<mime-type type="application/vnd.sun.xml.writer.global"/>
64<mime-type type="application/vnd.sun.xml.writer.template"/>
65<mime-type type="application/vnd.wordperfect"/>
66<mime-type type="application/wordperfect"/>
67<mime-type type="application/x-7z-compressed"/>
68<mime-type type="application/x-abiword"/>
69<mime-type type="application/x-amipro"/>
70<mime-type type="application/x-applix-spreadsheet"/>
71<mime-type type="application/x-applix-word"/>
72<mime-type type="application/x-archive"/>
73<mime-type type="application/x-arj"/>
74<mime-type type="application/x-asp"/>
75<mime-type type="application/x-bcpio"/>
76<mime-type type="application/x-bittorrent"/>
77<mime-type type="application/x-blender"/>
78<mime-type type="application/x-bzip"/>
79<mime-type type="application/x-bzip2"/>
80<mime-type type="application/x-bzip-compressed-tar"/>
81<mime-type type="application/x-cd-image"/>
82<mime-type type="application/x-cgi"/>
83<mime-type type="application/x-chess-pgn"/>
84<mime-type type="application/x-chm"/>
85<mime-type type="application/x-compress"/>
86<mime-type type="application/x-compressed-tar"/>
87<mime-type type="application/x-cpio"/>
88<mime-type type="application/x-cpio-compressed"/>
89<mime-type type="application/x-dbase"/>
90<mime-type type="application/x-dbm"/>
91<mime-type type="application/x-designer"/>
92<mime-type type="application/x-desktop"/>
93<mime-type type="application/x-dia-diagram"/>
94<mime-type type="application/x-dvi"/>
95<mime-type type="application/x-e-theme"/>
96<mime-type type="application/x-egon"/>
97<mime-type type="application/x-excellon"/>
98<mime-type type="application/x-flash-video"/>
99<mime-type type="application/x-font"/>
100<mime-type type="application/x-font-afm"/>
101<mime-type type="application/x-font-bdf"/>
102<mime-type type="application/x-font-dos"/>
103<mime-type type="application/x-font-framemaker"/>
104<mime-type type="application/x-font-libgrx"/>
105<mime-type type="application/x-font-linux-psf"/>
106<mime-type type="application/x-font-otf"/>
107<mime-type type="application/x-font-pcf"/>
108<mime-type type="application/x-font-speedo"/>
109<mime-type type="application/x-font-sunos-news"/>
110<mime-type type="application/x-font-tex"/>
111<mime-type type="application/x-font-tex-tfm"/>
112<mime-type type="application/x-font-ttf"/>
113<mime-type type="application/x-font-type1"/>
114<mime-type type="application/x-font-vfont"/>
115<mime-type type="application/x-frame"/>
116<mime-type type="application/x-gdbm"/>
117<mime-type type="application/x-geda-gsch2pcb-project"/>
118<mime-type type="application/x-geda-schematic"/>
119<mime-type type="application/x-geda-symbol"/>
120<mime-type type="application/x-gerber"/>
121<mime-type type="application/x-gettext-translation"/>
122<mime-type type="application/x-glade"/>
123<mime-type type="application/x-gmc-link"/>
124<mime-type type="application/x-gnome-app-info"/>
125<mime-type type="application/x-gnucash"/>
126<mime-type type="application/x-gnumeric"/>
127<mime-type type="application/x-graphite"/>
128<mime-type type="application/x-gtar"/>
129<mime-type type="application/x-gtktalog"/>
130<mime-type type="application/x-gzip"/>
131<mime-type type="application/x-gzpostscript"/>
132<mime-type type="application/x-hdf"/>
133<mime-type type="application/x-jar"/>
134<mime-type type="application/x-java"/>
135<mime-type type="application/x-java-jnlp-file"/>
136<mime-type type="application/x-jbuilder-project"/>
137<mime-type type="application/x-karbon"/>
138<mime-type type="application/x-kchart"/>
139<mime-type type="application/x-kformula"/>
140<mime-type type="application/x-killustrator"/>
141<mime-type type="application/x-kivio"/>
142<mime-type type="application/x-kontour"/>
143<mime-type type="application/x-kpovmodeler"/>
144<mime-type type="application/x-kpresenter"/>
145<mime-type type="application/x-krita"/>
146<mime-type type="application/x-kspread"/>
147<mime-type type="application/x-kspread-crypt"/>
148<mime-type type="application/x-ksysv-package"/>
149<mime-type type="application/x-kugar"/>
150<mime-type type="application/x-kword"/>
151<mime-type type="application/x-kword-crypt"/>
152<mime-type type="application/x-lha"/>
153<mime-type type="application/x-lhz"/>
154<mime-type type="application/x-linguist"/>
155<mime-type type="application/x-lyx"/>
156<mime-type type="application/x-lzop"/>
157<mime-type type="application/x-magicpoint"/>
158<mime-type type="application/x-matroska"/>
159<mime-type type="application/x-mif"/>
160<mime-type type="application/x-mozilla-bookmarks"/>
161<mime-type type="application/x-mswinurl"/>
162<mime-type type="application/x-mswrite"/>
163<mime-type type="application/x-nautilus-link"/>
164<mime-type type="application/x-netcdf"/>
165<mime-type type="application/x-netscape-bookmarks"/>
166<mime-type type="application/x-netshow-channel"/>
167<mime-type type="application/x-ogg"/>
168<mime-type type="application/x-oleo"/>
169<mime-type type="application/x-palm-database"/>
170<mime-type type="application/x-pcb-layout"/>
171<mime-type type="application/x-pcb-footprint"/>
172<mime-type type="application/x-pcb-netlist"/>
173<mime-type type="application/x-pdf"/>
174<mime-type type="application/x-php"/>
175<mime-type type="application/x-pkcs12"/>
176<mime-type type="application/x-profile"/>
177<mime-type type="application/x-pw"/>
178<mime-type type="application/x-quattropro"/>
179<mime-type type="application/x-quicktime-media-link"/>
180<mime-type type="application/x-quicktimeplayer"/>
181<mime-type type="application/x-qw"/>
182<mime-type type="application/x-rar"/>
183<mime-type type="application/x-reject"/>
184<mime-type type="application/x-rpm"/>
185<mime-type type="application/x-sc"/>
186<mime-type type="application/x-shar"/>
187<mime-type type="application/x-shared-library-la"/>
188<mime-type type="application/x-shockwave-flash"/>
189<mime-type type="application/x-siag"/>
190<mime-type type="application/x-sit"/>
191<mime-type type="application/x-slp"/>
192<mime-type type="application/x-smil"/>
193<mime-type type="application/x-stuffit"/>
194<mime-type type="application/x-sv4cpio"/>
195<mime-type type="application/x-sv4crc"/>
196<mime-type type="application/x-tar"/>
197<mime-type type="application/x-tarz"/>
198<mime-type type="application/x-tex-gf"/>
199<mime-type type="application/x-tex-pk"/>
200<mime-type type="application/x-tgif"/>
201<mime-type type="application/x-theme"/>
202<mime-type type="application/x-toutdoux"/>
203<mime-type type="application/x-trash"/>
204<mime-type type="application/x-troff"/>
205<mime-type type="application/x-troff-man"/>
206<mime-type type="application/x-troff-man-compressed"/>
207<mime-type type="application/x-tzo"/>
208<mime-type type="application/x-ustar"/>
209<mime-type type="application/x-wais-source"/>
210<mime-type type="application/x-wordperfect"/>
211<mime-type type="application/x-wpg"/>
212<mime-type type="application/x-x509-ca-cert"/>
213<mime-type type="application/x-xbel"/>
214<mime-type type="application/x-zerosize"/>
215<mime-type type="application/x-zip-compressed"/>
216<mime-type type="application/x-zoo"/>
217<mime-type type="application/xhtml+xml"/>
218<mime-type type="application/zip"/>
219<mime-type type="audio/ac3"/>
220<mime-type type="audio/AMR"/>
221<mime-type type="audio/AMR-WB"/>
222<mime-type type="audio/basic"/>
223<mime-type type="audio/midi"/>
224<mime-type type="audio/mpeg"/>
225<mime-type type="audio/mpegurl"/>
226<mime-type type="audio/ogg"/>
227<mime-type type="audio/playlist"/>
228<mime-type type="audio/prs.sid"/>
229<mime-type type="audio/vnd.rn-realaudio"/>
230<mime-type type="audio/vnd.wave"/>
231<mime-type type="audio/x-vorbis"/>
232<mime-type type="audio/wav"/>
233<mime-type type="audio/x-adpcm"/>
234<mime-type type="audio/x-aifc"/>
235<mime-type type="audio/x-aiff"/>
236<mime-type type="audio/x-aiffc"/>
237<mime-type type="audio/x-ape"/>
238<mime-type type="audio/x-flac"/>
239<mime-type type="audio/x-it"/>
240<mime-type type="audio/x-m4a"/>
241<mime-type type="audio/x-matroska"/>
242<mime-type type="audio/x-midi"/>
243<mime-type type="audio/x-mod"/>
244<mime-type type="audio/x-mp3"/>
245<mime-type type="audio/x-mp3-playlist"/>
246<mime-type type="audio/x-mpeg"/>
247<mime-type type="audio/x-mpegurl"/>
248<mime-type type="audio/x-ms-asx"/>
249<mime-type type="audio/x-ms-wax"/>
250<mime-type type="audio/x-musepack"/>
251<mime-type type="audio/x-pn-realaudio"/>
252<mime-type type="audio/x-pn-realaudio-plugin"/>
253<mime-type type="audio/x-realaudio"/>
254<mime-type type="audio/x-real-audio"/>
255<mime-type type="audio/x-riff"/>
256<mime-type type="audio/x-s3m"/>
257<mime-type type="audio/x-sbc"/>
258<mime-type type="audio/x-scpls"/>
259<mime-type type="audio/x-stm"/>
260<mime-type type="audio/x-tta"/>
261<mime-type type="audio/x-voc"/>
262<mime-type type="audio/x-wav"/>
263<mime-type type="audio/x-wavpack"/>
264<mime-type type="audio/x-xi"/>
265<mime-type type="audio/x-xm"/>
266<mime-type type="image/bmp"/>
267<mime-type type="image/cgm"/>
268<mime-type type="image/dpx"/>
269<mime-type type="image/fax-g3"/>
270<mime-type type="image/g3fax"/>
271<mime-type type="image/gif"/>
272<mime-type type="image/ief"/>
273<mime-type type="image/jpeg"/>
274<mime-type type="image/jpeg2000"/>
275<mime-type type="image/png"/>
276<mime-type type="image/rle"/>
277<mime-type type="image/svg+xml"/>
278<mime-type type="image/tiff"/>
279<mime-type type="image/vnd.djvu"/>
280<mime-type type="image/vnd.dwg"/>
281<mime-type type="image/vnd.dxf"/>
282<mime-type type="image/x-3ds"/>
283<mime-type type="image/x-applix-graphics"/>
284<mime-type type="image/x-cmu-raster"/>
285<mime-type type="image/x-compressed-xcf"/>
286<mime-type type="image/x-dcm"/>
287<mime-type type="image/x-dib"/>
288<mime-type type="image/x-djvu"/>
289<mime-type type="image/x-eps"/>
290<mime-type type="image/x-fits"/>
291<mime-type type="image/x-fpx"/>
292<mime-type type="image/x-icb"/>
293<mime-type type="image/x-ico"/>
294<mime-type type="image/x-iff"/>
295<mime-type type="image/x-ilbm"/>
296<mime-type type="image/x-jng"/>
297<mime-type type="image/x-lwo"/>
298<mime-type type="image/x-lws"/>
299<mime-type type="image/x-msod"/>
300<mime-type type="image/x-niff"/>
301<mime-type type="image/x-pcx"/>
302<mime-type type="image/x-photo-cd"/>
303<mime-type type="image/x-pict"/>
304<mime-type type="image/x-png"/>
305<mime-type type="image/x-portable-anymap"/>
306<mime-type type="image/x-portable-bitmap"/>
307<mime-type type="image/x-portable-graymap"/>
308<mime-type type="image/x-portable-pixmap"/>
309<mime-type type="image/x-psd"/>
310<mime-type type="image/x-rgb"/>
311<mime-type type="image/x-sgi"/>
312<mime-type type="image/x-sun-raster"/>
313<mime-type type="image/x-tga"/>
314<mime-type type="image/x-win-bitmap"/>
315<mime-type type="image/x-wmf"/>
316<mime-type type="image/x-xbitmap"/>
317<mime-type type="image/x-xcf"/>
318<mime-type type="image/x-xfig"/>
319<mime-type type="image/x-xpixmap"/>
320<mime-type type="image/x-xwindowdump"/>
321<mime-type type="message/delivery-status"/>
322<mime-type type="message/disposition-notification"/>
323<mime-type type="message/external-body"/>
324<mime-type type="message/news"/>
325<mime-type type="message/partial"/>
326<mime-type type="message/rfc822"/>
327<mime-type type="message/x-gnu-rmail"/>
328<mime-type type="model/vrml"/>
329<mime-type type="multipart/alternative"/>
330<mime-type type="multipart/appledouble"/>
331<mime-type type="multipart/digest"/>
332<mime-type type="multipart/encrypted"/>
333<mime-type type="multipart/mixed"/>
334<mime-type type="multipart/related"/>
335<mime-type type="multipart/report"/>
336<mime-type type="multipart/signed"/>
337<mime-type type="multipart/x-mixed-replace"/>
338<mime-type type="text/calendar"/>
339<mime-type type="text/css"/>
340<mime-type type="text/csv"/>
341<mime-type type="text/directory"/>
342<mime-type type="text/enriched"/>
343<mime-type type="text/google-video-pointer"/>
344<mime-type type="text/html"/>
345<mime-type type="text/htmlh"/>
346<mime-type type="text/mathml"/>
347<mime-type type="text/plain"/>
348<mime-type type="text/rdf"/>
349<mime-type type="text/rfc822-headers"/>
350<mime-type type="text/richtext"/>
351<mime-type type="text/rss"/>
352<mime-type type="text/rtf"/>
353<mime-type type="text/sgml"/>
354<mime-type type="text/spreadsheet"/>
355<mime-type type="text/tab-separated-values"/>
356<mime-type type="text/vnd.wap.wml"/>
357<mime-type type="text/x-adasrc"/>
358<mime-type type="text/x-authors"/>
359<mime-type type="text/x-bibtex"/>
360<mime-type type="text/x-c++hdr"/>
361<mime-type type="text/x-c++src"/>
362<mime-type type="text/x-chdr"/>
363<mime-type type="text/x-comma-separated-values"/>
364<mime-type type="text/x-copying"/>
365<mime-type type="text/x-credits"/>
366<mime-type type="text/x-csharp"/>
367<mime-type type="text/x-csrc"/>
368<mime-type type="text/x-dcl"/>
369<mime-type type="text/x-diff"/>
370<mime-type type="text/x-dsl"/>
371<mime-type type="text/x-dsrc"/>
372<mime-type type="text/x-dtd"/>
373<mime-type type="text/x-emacs-lisp"/>
374<mime-type type="text/x-fortran"/>
375<mime-type type="text/x-gettext-translation"/>
376<mime-type type="text/x-gettext-translation-template"/>
377<mime-type type="text/x-google-video-pointer"/>
378<mime-type type="text/x-gtkrc"/>
379<mime-type type="text/x-haskell"/>
380<mime-type type="text/x-idl"/>
381<mime-type type="text/x-install"/>
382<mime-type type="text/x-java"/>
383<mime-type type="text/x-ksysv-log"/>
384<mime-type type="text/x-literate-haskell"/>
385<mime-type type="text/x-log"/>
386<mime-type type="text/x-makefile"/>
387<mime-type type="text/x-moc"/>
388<mime-type type="text/x-objcsrc"/>
389<mime-type type="text/x-pascal"/>
390<mime-type type="text/x-patch"/>
391<mime-type type="text/x-python"/>
392<mime-type type="text/x-readme"/>
393<mime-type type="text/x-scheme"/>
394<mime-type type="text/x-setext"/>
395<mime-type type="text/x-speech"/>
396<mime-type type="text/x-sql"/>
397<mime-type type="text/x-tcl"/>
398<mime-type type="text/x-tex"/>
399<mime-type type="text/x-texinfo"/>
400<mime-type type="text/x-troff-me"/>
401<mime-type type="text/x-troff-mm"/>
402<mime-type type="text/x-troff-ms"/>
403<mime-type type="text/x-uil"/>
404<mime-type type="text/x-uri"/>
405<mime-type type="text/x-vcalendar"/>
406<mime-type type="text/x-vcard"/>
407<mime-type type="text/x-xmi"/>
408<mime-type type="text/x-xslfo"/>
409<mime-type type="text/x-xslt"/>
410<mime-type type="text/xmcd"/>
411<mime-type type="text/xml"/>
412<mime-type type="video/flv"/>
413<mime-type type="video/isivideo"/>
414<mime-type type="video/mp4"/>
415<mime-type type="video/mpeg"/>
416<mime-type type="video/quicktime"/>
417<mime-type type="video/vivo"/>
418<mime-type type="video/wavelet"/>
419<mime-type type="video/x-anim"/>
420<mime-type type="video/x-avi"/>
421<mime-type type="video/x-flic"/>
422<mime-type type="video/x-flv"/>
423<mime-type type="video/x-m4v"/>
424<mime-type type="video/x-matroska"/>
425<mime-type type="video/x-mng"/>
426<mime-type type="video/x-ms-asf"/>
427<mime-type type="video/x-ms-asf-plugin"/>
428<mime-type type="video/x-ms-wmv"/>
429<mime-type type="video/x-ms-wvx"/>
430<mime-type type="video/x-msvideo"/>
431<mime-type type="video/x-nsv"/>
432<mime-type type="video/x-ogm+ogg"/>
433<mime-type type="video/x-real-video"/>
434<mime-type type="video/x-theora+ogg"/>
435<mime-type type="video/x-sgi-movie"/>
436</safe>
437<unsafe>
438<mime-type type="application/mac-binhex40"/>
439<mime-type type="application/vnd.hp-hpgl"/>
440<mime-type type="application/vnd.hp-pcl"/>
441<mime-type type="application/vnd.mozilla.xul+xml"/>
442<mime-type type="application/vnd.palm"/>
443<mime-type type="application/x-arc"/>
444<mime-type type="application/x-awk"/>
445<mime-type type="application/x-class-file"/>
446<mime-type type="application/x-core"/>
447<mime-type type="application/x-csh"/>
448<mime-type type="application/x-dc-rom"/>
449<mime-type type="application/x-deb"/>
450<mime-type type="application/x-executable"/>
451<mime-type type="application/x-gameboy-rom"/>
452<mime-type type="application/x-genesis-rom"/>
453<mime-type type="application/x-ipod-firmware"/>
454<mime-type type="application/x-javascript"/>
455<mime-type type="application/x-macbinary"/>
456<mime-type type="application/x-mplayer2"/>
457<mime-type type="application/x-ms-dos-executable"/>
458<mime-type type="application/x-msx-rom"/>
459<mime-type type="application/x-n64-rom"/>
460<mime-type type="application/x-nes-rom"/>
461<mime-type type="application/x-object"/>
462<mime-type type="application/x-ole-storage"/>
463<mime-type type="application/x-par2"/>
464<mime-type type="application/x-pef-executable"/>
465<mime-type type="application/x-perl"/>
466<mime-type type="application/x-python"/>
467<mime-type type="application/x-python-bytecode"/>
468<mime-type type="application/x-ruby"/>
469<mime-type type="application/x-sharedlib"/>
470<mime-type type="application/x-shellscript"/>
471<mime-type type="application/x-sms-rom"/>
472<mime-type type="application/x-xpinstall"/>
473<mime-type type="inode/blockdevice"/>
474<mime-type type="inode/chardevice"/>
475<mime-type type="inode/directory"/>
476<mime-type type="inode/fifo"/>
477<mime-type type="inode/mount-point"/>
478<mime-type type="inode/socket"/>
479<mime-type type="inode/symlink"/>
480<mime-type type="text/x-ksh"/>
481</unsafe>
482</mime-types-permissions>
0483
=== removed file '.pc/12_safetypes.patch/data/mime-types-permissions.xml'
--- .pc/12_safetypes.patch/data/mime-types-permissions.xml 2010-07-03 01:38:24 +0000
+++ .pc/12_safetypes.patch/data/mime-types-permissions.xml 1970-01-01 00:00:00 +0000
@@ -1,482 +0,0 @@
1<mime-types-permissions>
2<safe>
3<mime-type type="application/andrew-inset"/>
4<mime-type type="application/dicom"/>
5<mime-type type="application/illustrator"/>
6<mime-type type="application/mathematica"/>
7<mime-type type="application/msexcel"/>
8<mime-type type="application/msword"/>
9<mime-type type="application/octet-stream"/>
10<mime-type type="application/oda"/>
11<mime-type type="application/ogg"/>
12<mime-type type="application/pdf"/>
13<mime-type type="application/pgp"/>
14<mime-type type="application/pgp-encrypted"/>
15<mime-type type="application/pgp-keys"/>
16<mime-type type="application/pgp-signature"/>
17<mime-type type="application/pkcs7-mime"/>
18<mime-type type="application/pkcs7-signature"/>
19<mime-type type="application/postscript"/>
20<mime-type type="application/ram"/>
21<mime-type type="application/rdf+xml"/>
22<mime-type type="application/rtf"/>
23<mime-type type="application/sdp"/>
24<mime-type type="application/smil"/>
25<mime-type type="application/stuffit"/>
26<mime-type type="application/vlc"/>
27<mime-type type="application/vnd.corel-draw"/>
28<mime-type type="application/vnd.emusic-emusic_package"/>
29<mime-type type="application/vnd.lotus-1-2-3"/>
30<mime-type type="application/vnd.ms-excel"/>
31<mime-type type="application/vnd.ms-powerpoint"/>
32<mime-type type="application/vnd.ms-word"/>
33<mime-type type="application/vnd.oasis.opendocument.text"/>
34<mime-type type="application/vnd.oasis.opendocument.text-template"/>
35<mime-type type="application/vnd.oasis.opendocument.text-web"/>
36<mime-type type="application/vnd.oasis.opendocument.text-master"/>
37<mime-type type="application/vnd.oasis.opendocument.graphics"/>
38<mime-type type="application/vnd.oasis.opendocument.graphics-template"/>
39<mime-type type="application/vnd.oasis.opendocument.presentation"/>
40<mime-type type="application/vnd.oasis.opendocument.presentation-template"/>
41<mime-type type="application/vnd.oasis.opendocument.spreadsheet"/>
42<mime-type type="application/vnd.oasis.opendocument.spreadsheet-template"/>
43<mime-type type="application/vnd.oasis.opendocument.chart"/>
44<mime-type type="application/vnd.oasis.opendocument.formula"/>
45<mime-type type="application/vnd.oasis.opendocument.database"/>
46<mime-type type="application/vnd.oasis.opendocument.image"/>
47<mime-type type="application/vnd.rn-realmedia"/>
48<mime-type type="application/vnd.stardivision.calc"/>
49<mime-type type="application/vnd.stardivision.chart"/>
50<mime-type type="application/vnd.stardivision.draw"/>
51<mime-type type="application/vnd.stardivision.impress"/>
52<mime-type type="application/vnd.stardivision.mail"/>
53<mime-type type="application/vnd.stardivision.math"/>
54<mime-type type="application/vnd.stardivision.writer"/>
55<mime-type type="application/vnd.sun.xml.calc"/>
56<mime-type type="application/vnd.sun.xml.calc.template"/>
57<mime-type type="application/vnd.sun.xml.draw"/>
58<mime-type type="application/vnd.sun.xml.draw.template"/>
59<mime-type type="application/vnd.sun.xml.impress"/>
60<mime-type type="application/vnd.sun.xml.impress.template"/>
61<mime-type type="application/vnd.sun.xml.math"/>
62<mime-type type="application/vnd.sun.xml.writer"/>
63<mime-type type="application/vnd.sun.xml.writer.global"/>
64<mime-type type="application/vnd.sun.xml.writer.template"/>
65<mime-type type="application/vnd.wordperfect"/>
66<mime-type type="application/wordperfect"/>
67<mime-type type="application/x-7z-compressed"/>
68<mime-type type="application/x-abiword"/>
69<mime-type type="application/x-amipro"/>
70<mime-type type="application/x-applix-spreadsheet"/>
71<mime-type type="application/x-applix-word"/>
72<mime-type type="application/x-archive"/>
73<mime-type type="application/x-arj"/>
74<mime-type type="application/x-asp"/>
75<mime-type type="application/x-bcpio"/>
76<mime-type type="application/x-bittorrent"/>
77<mime-type type="application/x-blender"/>
78<mime-type type="application/x-bzip"/>
79<mime-type type="application/x-bzip2"/>
80<mime-type type="application/x-bzip-compressed-tar"/>
81<mime-type type="application/x-cd-image"/>
82<mime-type type="application/x-cgi"/>
83<mime-type type="application/x-chess-pgn"/>
84<mime-type type="application/x-chm"/>
85<mime-type type="application/x-compress"/>
86<mime-type type="application/x-compressed-tar"/>
87<mime-type type="application/x-cpio"/>
88<mime-type type="application/x-cpio-compressed"/>
89<mime-type type="application/x-dbase"/>
90<mime-type type="application/x-dbm"/>
91<mime-type type="application/x-designer"/>
92<mime-type type="application/x-desktop"/>
93<mime-type type="application/x-dia-diagram"/>
94<mime-type type="application/x-dvi"/>
95<mime-type type="application/x-e-theme"/>
96<mime-type type="application/x-egon"/>
97<mime-type type="application/x-excellon"/>
98<mime-type type="application/x-flash-video"/>
99<mime-type type="application/x-font"/>
100<mime-type type="application/x-font-afm"/>
101<mime-type type="application/x-font-bdf"/>
102<mime-type type="application/x-font-dos"/>
103<mime-type type="application/x-font-framemaker"/>
104<mime-type type="application/x-font-libgrx"/>
105<mime-type type="application/x-font-linux-psf"/>
106<mime-type type="application/x-font-otf"/>
107<mime-type type="application/x-font-pcf"/>
108<mime-type type="application/x-font-speedo"/>
109<mime-type type="application/x-font-sunos-news"/>
110<mime-type type="application/x-font-tex"/>
111<mime-type type="application/x-font-tex-tfm"/>
112<mime-type type="application/x-font-ttf"/>
113<mime-type type="application/x-font-type1"/>
114<mime-type type="application/x-font-vfont"/>
115<mime-type type="application/x-frame"/>
116<mime-type type="application/x-gdbm"/>
117<mime-type type="application/x-geda-gsch2pcb-project"/>
118<mime-type type="application/x-geda-schematic"/>
119<mime-type type="application/x-geda-symbol"/>
120<mime-type type="application/x-gerber"/>
121<mime-type type="application/x-gettext-translation"/>
122<mime-type type="application/x-glade"/>
123<mime-type type="application/x-gmc-link"/>
124<mime-type type="application/x-gnome-app-info"/>
125<mime-type type="application/x-gnucash"/>
126<mime-type type="application/x-gnumeric"/>
127<mime-type type="application/x-graphite"/>
128<mime-type type="application/x-gtar"/>
129<mime-type type="application/x-gtktalog"/>
130<mime-type type="application/x-gzip"/>
131<mime-type type="application/x-gzpostscript"/>
132<mime-type type="application/x-hdf"/>
133<mime-type type="application/x-jar"/>
134<mime-type type="application/x-java"/>
135<mime-type type="application/x-java-jnlp-file"/>
136<mime-type type="application/x-jbuilder-project"/>
137<mime-type type="application/x-karbon"/>
138<mime-type type="application/x-kchart"/>
139<mime-type type="application/x-kformula"/>
140<mime-type type="application/x-killustrator"/>
141<mime-type type="application/x-kivio"/>
142<mime-type type="application/x-kontour"/>
143<mime-type type="application/x-kpovmodeler"/>
144<mime-type type="application/x-kpresenter"/>
145<mime-type type="application/x-krita"/>
146<mime-type type="application/x-kspread"/>
147<mime-type type="application/x-kspread-crypt"/>
148<mime-type type="application/x-ksysv-package"/>
149<mime-type type="application/x-kugar"/>
150<mime-type type="application/x-kword"/>
151<mime-type type="application/x-kword-crypt"/>
152<mime-type type="application/x-lha"/>
153<mime-type type="application/x-lhz"/>
154<mime-type type="application/x-linguist"/>
155<mime-type type="application/x-lyx"/>
156<mime-type type="application/x-lzop"/>
157<mime-type type="application/x-magicpoint"/>
158<mime-type type="application/x-matroska"/>
159<mime-type type="application/x-mif"/>
160<mime-type type="application/x-mozilla-bookmarks"/>
161<mime-type type="application/x-mswinurl"/>
162<mime-type type="application/x-mswrite"/>
163<mime-type type="application/x-nautilus-link"/>
164<mime-type type="application/x-netcdf"/>
165<mime-type type="application/x-netscape-bookmarks"/>
166<mime-type type="application/x-netshow-channel"/>
167<mime-type type="application/x-ogg"/>
168<mime-type type="application/x-oleo"/>
169<mime-type type="application/x-palm-database"/>
170<mime-type type="application/x-pcb-layout"/>
171<mime-type type="application/x-pcb-footprint"/>
172<mime-type type="application/x-pcb-netlist"/>
173<mime-type type="application/x-pdf"/>
174<mime-type type="application/x-php"/>
175<mime-type type="application/x-pkcs12"/>
176<mime-type type="application/x-profile"/>
177<mime-type type="application/x-pw"/>
178<mime-type type="application/x-quattropro"/>
179<mime-type type="application/x-quicktime-media-link"/>
180<mime-type type="application/x-quicktimeplayer"/>
181<mime-type type="application/x-qw"/>
182<mime-type type="application/x-rar"/>
183<mime-type type="application/x-reject"/>
184<mime-type type="application/x-rpm"/>
185<mime-type type="application/x-sc"/>
186<mime-type type="application/x-shar"/>
187<mime-type type="application/x-shared-library-la"/>
188<mime-type type="application/x-shockwave-flash"/>
189<mime-type type="application/x-siag"/>
190<mime-type type="application/x-sit"/>
191<mime-type type="application/x-slp"/>
192<mime-type type="application/x-smil"/>
193<mime-type type="application/x-stuffit"/>
194<mime-type type="application/x-sv4cpio"/>
195<mime-type type="application/x-sv4crc"/>
196<mime-type type="application/x-tar"/>
197<mime-type type="application/x-tarz"/>
198<mime-type type="application/x-tex-gf"/>
199<mime-type type="application/x-tex-pk"/>
200<mime-type type="application/x-tgif"/>
201<mime-type type="application/x-theme"/>
202<mime-type type="application/x-toutdoux"/>
203<mime-type type="application/x-trash"/>
204<mime-type type="application/x-troff"/>
205<mime-type type="application/x-troff-man"/>
206<mime-type type="application/x-troff-man-compressed"/>
207<mime-type type="application/x-tzo"/>
208<mime-type type="application/x-ustar"/>
209<mime-type type="application/x-wais-source"/>
210<mime-type type="application/x-wordperfect"/>
211<mime-type type="application/x-wpg"/>
212<mime-type type="application/x-x509-ca-cert"/>
213<mime-type type="application/x-xbel"/>
214<mime-type type="application/x-zerosize"/>
215<mime-type type="application/x-zip-compressed"/>
216<mime-type type="application/x-zoo"/>
217<mime-type type="application/xhtml+xml"/>
218<mime-type type="application/zip"/>
219<mime-type type="audio/ac3"/>
220<mime-type type="audio/AMR"/>
221<mime-type type="audio/AMR-WB"/>
222<mime-type type="audio/basic"/>
223<mime-type type="audio/midi"/>
224<mime-type type="audio/mpeg"/>
225<mime-type type="audio/mpegurl"/>
226<mime-type type="audio/ogg"/>
227<mime-type type="audio/playlist"/>
228<mime-type type="audio/prs.sid"/>
229<mime-type type="audio/vnd.rn-realaudio"/>
230<mime-type type="audio/vnd.wave"/>
231<mime-type type="audio/x-vorbis"/>
232<mime-type type="audio/wav"/>
233<mime-type type="audio/x-adpcm"/>
234<mime-type type="audio/x-aifc"/>
235<mime-type type="audio/x-aiff"/>
236<mime-type type="audio/x-aiffc"/>
237<mime-type type="audio/x-ape"/>
238<mime-type type="audio/x-flac"/>
239<mime-type type="audio/x-it"/>
240<mime-type type="audio/x-m4a"/>
241<mime-type type="audio/x-matroska"/>
242<mime-type type="audio/x-midi"/>
243<mime-type type="audio/x-mod"/>
244<mime-type type="audio/x-mp3"/>
245<mime-type type="audio/x-mp3-playlist"/>
246<mime-type type="audio/x-mpeg"/>
247<mime-type type="audio/x-mpegurl"/>
248<mime-type type="audio/x-ms-asx"/>
249<mime-type type="audio/x-ms-wax"/>
250<mime-type type="audio/x-musepack"/>
251<mime-type type="audio/x-pn-realaudio"/>
252<mime-type type="audio/x-pn-realaudio-plugin"/>
253<mime-type type="audio/x-realaudio"/>
254<mime-type type="audio/x-real-audio"/>
255<mime-type type="audio/x-riff"/>
256<mime-type type="audio/x-s3m"/>
257<mime-type type="audio/x-sbc"/>
258<mime-type type="audio/x-scpls"/>
259<mime-type type="audio/x-stm"/>
260<mime-type type="audio/x-tta"/>
261<mime-type type="audio/x-voc"/>
262<mime-type type="audio/x-wav"/>
263<mime-type type="audio/x-wavpack"/>
264<mime-type type="audio/x-xi"/>
265<mime-type type="audio/x-xm"/>
266<mime-type type="image/bmp"/>
267<mime-type type="image/cgm"/>
268<mime-type type="image/dpx"/>
269<mime-type type="image/fax-g3"/>
270<mime-type type="image/g3fax"/>
271<mime-type type="image/gif"/>
272<mime-type type="image/ief"/>
273<mime-type type="image/jpeg"/>
274<mime-type type="image/jpeg2000"/>
275<mime-type type="image/png"/>
276<mime-type type="image/rle"/>
277<mime-type type="image/svg+xml"/>
278<mime-type type="image/tiff"/>
279<mime-type type="image/vnd.djvu"/>
280<mime-type type="image/vnd.dwg"/>
281<mime-type type="image/vnd.dxf"/>
282<mime-type type="image/x-3ds"/>
283<mime-type type="image/x-applix-graphics"/>
284<mime-type type="image/x-cmu-raster"/>
285<mime-type type="image/x-compressed-xcf"/>
286<mime-type type="image/x-dcm"/>
287<mime-type type="image/x-dib"/>
288<mime-type type="image/x-djvu"/>
289<mime-type type="image/x-eps"/>
290<mime-type type="image/x-fits"/>
291<mime-type type="image/x-fpx"/>
292<mime-type type="image/x-icb"/>
293<mime-type type="image/x-ico"/>
294<mime-type type="image/x-iff"/>
295<mime-type type="image/x-ilbm"/>
296<mime-type type="image/x-jng"/>
297<mime-type type="image/x-lwo"/>
298<mime-type type="image/x-lws"/>
299<mime-type type="image/x-msod"/>
300<mime-type type="image/x-niff"/>
301<mime-type type="image/x-pcx"/>
302<mime-type type="image/x-photo-cd"/>
303<mime-type type="image/x-pict"/>
304<mime-type type="image/x-png"/>
305<mime-type type="image/x-portable-anymap"/>
306<mime-type type="image/x-portable-bitmap"/>
307<mime-type type="image/x-portable-graymap"/>
308<mime-type type="image/x-portable-pixmap"/>
309<mime-type type="image/x-psd"/>
310<mime-type type="image/x-rgb"/>
311<mime-type type="image/x-sgi"/>
312<mime-type type="image/x-sun-raster"/>
313<mime-type type="image/x-tga"/>
314<mime-type type="image/x-win-bitmap"/>
315<mime-type type="image/x-wmf"/>
316<mime-type type="image/x-xbitmap"/>
317<mime-type type="image/x-xcf"/>
318<mime-type type="image/x-xfig"/>
319<mime-type type="image/x-xpixmap"/>
320<mime-type type="image/x-xwindowdump"/>
321<mime-type type="message/delivery-status"/>
322<mime-type type="message/disposition-notification"/>
323<mime-type type="message/external-body"/>
324<mime-type type="message/news"/>
325<mime-type type="message/partial"/>
326<mime-type type="message/rfc822"/>
327<mime-type type="message/x-gnu-rmail"/>
328<mime-type type="model/vrml"/>
329<mime-type type="multipart/alternative"/>
330<mime-type type="multipart/appledouble"/>
331<mime-type type="multipart/digest"/>
332<mime-type type="multipart/encrypted"/>
333<mime-type type="multipart/mixed"/>
334<mime-type type="multipart/related"/>
335<mime-type type="multipart/report"/>
336<mime-type type="multipart/signed"/>
337<mime-type type="multipart/x-mixed-replace"/>
338<mime-type type="text/calendar"/>
339<mime-type type="text/css"/>
340<mime-type type="text/csv"/>
341<mime-type type="text/directory"/>
342<mime-type type="text/enriched"/>
343<mime-type type="text/google-video-pointer"/>
344<mime-type type="text/html"/>
345<mime-type type="text/htmlh"/>
346<mime-type type="text/mathml"/>
347<mime-type type="text/plain"/>
348<mime-type type="text/rdf"/>
349<mime-type type="text/rfc822-headers"/>
350<mime-type type="text/richtext"/>
351<mime-type type="text/rss"/>
352<mime-type type="text/rtf"/>
353<mime-type type="text/sgml"/>
354<mime-type type="text/spreadsheet"/>
355<mime-type type="text/tab-separated-values"/>
356<mime-type type="text/vnd.wap.wml"/>
357<mime-type type="text/x-adasrc"/>
358<mime-type type="text/x-authors"/>
359<mime-type type="text/x-bibtex"/>
360<mime-type type="text/x-c++hdr"/>
361<mime-type type="text/x-c++src"/>
362<mime-type type="text/x-chdr"/>
363<mime-type type="text/x-comma-separated-values"/>
364<mime-type type="text/x-copying"/>
365<mime-type type="text/x-credits"/>
366<mime-type type="text/x-csharp"/>
367<mime-type type="text/x-csrc"/>
368<mime-type type="text/x-dcl"/>
369<mime-type type="text/x-diff"/>
370<mime-type type="text/x-dsl"/>
371<mime-type type="text/x-dsrc"/>
372<mime-type type="text/x-dtd"/>
373<mime-type type="text/x-emacs-lisp"/>
374<mime-type type="text/x-fortran"/>
375<mime-type type="text/x-gettext-translation"/>
376<mime-type type="text/x-gettext-translation-template"/>
377<mime-type type="text/x-google-video-pointer"/>
378<mime-type type="text/x-gtkrc"/>
379<mime-type type="text/x-haskell"/>
380<mime-type type="text/x-idl"/>
381<mime-type type="text/x-install"/>
382<mime-type type="text/x-java"/>
383<mime-type type="text/x-ksysv-log"/>
384<mime-type type="text/x-literate-haskell"/>
385<mime-type type="text/x-log"/>
386<mime-type type="text/x-makefile"/>
387<mime-type type="text/x-moc"/>
388<mime-type type="text/x-objcsrc"/>
389<mime-type type="text/x-pascal"/>
390<mime-type type="text/x-patch"/>
391<mime-type type="text/x-python"/>
392<mime-type type="text/x-readme"/>
393<mime-type type="text/x-scheme"/>
394<mime-type type="text/x-setext"/>
395<mime-type type="text/x-speech"/>
396<mime-type type="text/x-sql"/>
397<mime-type type="text/x-tcl"/>
398<mime-type type="text/x-tex"/>
399<mime-type type="text/x-texinfo"/>
400<mime-type type="text/x-troff-me"/>
401<mime-type type="text/x-troff-mm"/>
402<mime-type type="text/x-troff-ms"/>
403<mime-type type="text/x-uil"/>
404<mime-type type="text/x-uri"/>
405<mime-type type="text/x-vcalendar"/>
406<mime-type type="text/x-vcard"/>
407<mime-type type="text/x-xmi"/>
408<mime-type type="text/x-xslfo"/>
409<mime-type type="text/x-xslt"/>
410<mime-type type="text/xmcd"/>
411<mime-type type="text/xml"/>
412<mime-type type="video/flv"/>
413<mime-type type="video/isivideo"/>
414<mime-type type="video/mp4"/>
415<mime-type type="video/mpeg"/>
416<mime-type type="video/quicktime"/>
417<mime-type type="video/vivo"/>
418<mime-type type="video/wavelet"/>
419<mime-type type="video/x-anim"/>
420<mime-type type="video/x-avi"/>
421<mime-type type="video/x-flic"/>
422<mime-type type="video/x-flv"/>
423<mime-type type="video/x-m4v"/>
424<mime-type type="video/x-matroska"/>
425<mime-type type="video/x-mng"/>
426<mime-type type="video/x-ms-asf"/>
427<mime-type type="video/x-ms-asf-plugin"/>
428<mime-type type="video/x-ms-wmv"/>
429<mime-type type="video/x-ms-wvx"/>
430<mime-type type="video/x-msvideo"/>
431<mime-type type="video/x-nsv"/>
432<mime-type type="video/x-ogm+ogg"/>
433<mime-type type="video/x-real-video"/>
434<mime-type type="video/x-theora+ogg"/>
435<mime-type type="video/x-sgi-movie"/>
436</safe>
437<unsafe>
438<mime-type type="application/mac-binhex40"/>
439<mime-type type="application/vnd.hp-hpgl"/>
440<mime-type type="application/vnd.hp-pcl"/>
441<mime-type type="application/vnd.mozilla.xul+xml"/>
442<mime-type type="application/vnd.palm"/>
443<mime-type type="application/x-arc"/>
444<mime-type type="application/x-awk"/>
445<mime-type type="application/x-class-file"/>
446<mime-type type="application/x-core"/>
447<mime-type type="application/x-csh"/>
448<mime-type type="application/x-dc-rom"/>
449<mime-type type="application/x-deb"/>
450<mime-type type="application/x-executable"/>
451<mime-type type="application/x-gameboy-rom"/>
452<mime-type type="application/x-genesis-rom"/>
453<mime-type type="application/x-ipod-firmware"/>
454<mime-type type="application/x-javascript"/>
455<mime-type type="application/x-macbinary"/>
456<mime-type type="application/x-mplayer2"/>
457<mime-type type="application/x-ms-dos-executable"/>
458<mime-type type="application/x-msx-rom"/>
459<mime-type type="application/x-n64-rom"/>
460<mime-type type="application/x-nes-rom"/>
461<mime-type type="application/x-object"/>
462<mime-type type="application/x-ole-storage"/>
463<mime-type type="application/x-par2"/>
464<mime-type type="application/x-pef-executable"/>
465<mime-type type="application/x-perl"/>
466<mime-type type="application/x-python"/>
467<mime-type type="application/x-python-bytecode"/>
468<mime-type type="application/x-ruby"/>
469<mime-type type="application/x-sharedlib"/>
470<mime-type type="application/x-shellscript"/>
471<mime-type type="application/x-sms-rom"/>
472<mime-type type="application/x-xpinstall"/>
473<mime-type type="inode/blockdevice"/>
474<mime-type type="inode/chardevice"/>
475<mime-type type="inode/directory"/>
476<mime-type type="inode/fifo"/>
477<mime-type type="inode/mount-point"/>
478<mime-type type="inode/socket"/>
479<mime-type type="inode/symlink"/>
480<mime-type type="text/x-ksh"/>
481</unsafe>
482</mime-types-permissions>
4830
=== added directory '.pc/81_ubuntu_force_update_bookmarks_menu.patch'
=== removed directory '.pc/81_ubuntu_force_update_bookmarks_menu.patch'
=== added file '.pc/81_ubuntu_force_update_bookmarks_menu.patch/.timestamp'
=== added directory '.pc/81_ubuntu_force_update_bookmarks_menu.patch/src'
=== removed directory '.pc/81_ubuntu_force_update_bookmarks_menu.patch/src'
=== added directory '.pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks'
=== removed directory '.pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks'
=== added file '.pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks/ephy-bookmarks-ui.c'
--- .pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks/ephy-bookmarks-ui.c 1970-01-01 00:00:00 +0000
+++ .pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks/ephy-bookmarks-ui.c 2015-07-11 21:08:34 +0000
@@ -0,0 +1,363 @@
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2/*
3 * Copyright © 2005 Peter Harvey
4 * Copyright © 2006 Christian Persch
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 *
20 */
21
22#include "config.h"
23#include "ephy-bookmarks-ui.h"
24
25#include "ephy-bookmark-action-group.h"
26#include "ephy-bookmark-action.h"
27#include "ephy-bookmark-properties.h"
28#include "ephy-bookmarks-menu.h"
29#include "ephy-bookmarks.h"
30#include "ephy-debug.h"
31#include "ephy-dnd.h"
32#include "ephy-embed-shell.h"
33#include "ephy-file-helpers.h"
34#include "ephy-gui.h"
35#include "ephy-link.h"
36#include "ephy-node-common.h"
37#include "ephy-open-tabs-action.h"
38#include "ephy-prefs.h"
39#include "ephy-settings.h"
40#include "ephy-shell.h"
41#include "ephy-string.h"
42#include "ephy-topic-action-group.h"
43#include "ephy-topic-action.h"
44
45#include <string.h>
46#include <glib/gi18n.h>
47#include <gtk/gtk.h>
48
49#define BM_WINDOW_DATA_KEY "bookmarks-window-data"
50
51typedef struct
52{
53 guint bookmarks_menu;
54 guint toolbar_menu;
55} BookmarksWindowData;
56
57enum
58{
59 RESPONSE_SHOW_PROPERTIES = 1,
60 RESPONSE_NEW_BOOKMARK = 2
61};
62
63static GString * bookmarks_menu_string = 0;
64static GHashTable *properties_dialogs = 0;
65
66static GtkAction *
67find_action (GtkUIManager *manager, const char *name)
68{
69 GList *l = gtk_ui_manager_get_action_groups (manager);
70 GtkAction *action;
71
72 while (l != NULL)
73 {
74 action = gtk_action_group_get_action (GTK_ACTION_GROUP (l->data), name);
75 if (action) return action;
76 l = l->next;
77 }
78
79 return NULL;
80}
81
82static void
83activate_bookmarks_menu (GtkAction *action, EphyWindow *window)
84{
85 BookmarksWindowData *data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
86 if (data && !data->bookmarks_menu)
87 {
88 GtkUIManager *manager = ephy_window_get_ui_manager (window);
89 gtk_ui_manager_ensure_update (manager);
90
91 if (!bookmarks_menu_string->len)
92 {
93 g_string_append (bookmarks_menu_string,
94 "<ui><popup name=\"PagePopup\" action=\"PagePopupAction\"><menu name=\"BookmarksMenu\" action=\"Bookmarks\">");
95 ephy_bookmarks_menu_build (bookmarks_menu_string, 0);
96 g_string_append (bookmarks_menu_string, "</menu></popup></ui>");
97 }
98
99 data->bookmarks_menu = gtk_ui_manager_add_ui_from_string
100 (manager, bookmarks_menu_string->str, bookmarks_menu_string->len, 0);
101
102 gtk_ui_manager_ensure_update (manager);
103 }
104}
105
106static void
107erase_bookmarks_menu (EphyWindow *window)
108{
109 BookmarksWindowData *data;
110 GtkUIManager *manager;
111
112 manager = ephy_window_get_ui_manager (window);
113 data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
114
115 if (data != NULL && data->bookmarks_menu != 0)
116 {
117 gtk_ui_manager_remove_ui (manager, data->bookmarks_menu);
118 data->bookmarks_menu = 0;
119 }
120
121 g_string_truncate (bookmarks_menu_string, 0);
122}
123
124static void
125tree_changed_cb (EphyBookmarks *bookmarks,
126 EphyWindow *window)
127{
128 erase_bookmarks_menu (window);
129}
130
131static void
132node_added_cb (EphyNode *parent,
133 EphyNode *child,
134 EphyWindow *window)
135{
136 erase_bookmarks_menu (window);
137}
138
139static void
140node_changed_cb (EphyNode *parent,
141 EphyNode *child,
142 guint property_id,
143 EphyWindow *window)
144{
145 if (property_id == EPHY_NODE_KEYWORD_PROP_NAME ||
146 property_id == EPHY_NODE_BMK_PROP_TITLE)
147 {
148 erase_bookmarks_menu (window);
149 }
150}
151
152static void
153node_removed_cb (EphyNode *parent,
154 EphyNode *child,
155 guint index,
156 EphyWindow *window)
157{
158 erase_bookmarks_menu (window);
159}
160
161void
162ephy_bookmarks_ui_attach_window (EphyWindow *window)
163{
164 EphyBookmarks *eb;
165 EphyNode *bookmarks;
166 EphyNode *topics;
167 BookmarksWindowData *data;
168 GtkUIManager *manager;
169 GtkActionGroup *actions;
170 GtkAction *action;
171
172 eb = ephy_shell_get_bookmarks (ephy_shell_get_default ());
173 bookmarks = ephy_bookmarks_get_bookmarks (eb);
174 topics = ephy_bookmarks_get_keywords (eb);
175 data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
176 g_return_if_fail (data == NULL);
177
178 manager = ephy_window_get_ui_manager (window);
179
180 data = g_new0 (BookmarksWindowData, 1);
181 g_object_set_data_full (G_OBJECT (window), BM_WINDOW_DATA_KEY, data, g_free);
182
183 /* Create the self-maintaining action groups for bookmarks and topics */
184 actions = ephy_bookmark_group_new (bookmarks);
185 gtk_ui_manager_insert_action_group (manager, actions, -1);
186 g_signal_connect_object (actions, "open-link",
187 G_CALLBACK (ephy_link_open), G_OBJECT (window),
188 G_CONNECT_SWAPPED | G_CONNECT_AFTER);
189 g_object_unref (actions);
190
191 actions = ephy_topic_action_group_new (topics, manager);
192 gtk_ui_manager_insert_action_group (manager, actions, -1);
193 g_object_unref (actions);
194
195 actions = ephy_open_tabs_group_new (topics);
196 gtk_ui_manager_insert_action_group (manager, actions, -1);
197 g_signal_connect_object (actions, "open-link",
198 G_CALLBACK (ephy_link_open), G_OBJECT (window),
199 G_CONNECT_SWAPPED | G_CONNECT_AFTER);
200 g_object_unref (actions);
201
202 /* Add signal handlers for the bookmark database */
203 ephy_node_signal_connect_object (bookmarks, EPHY_NODE_CHILD_ADDED,
204 (EphyNodeCallback)node_added_cb,
205 G_OBJECT (window));
206 ephy_node_signal_connect_object (topics, EPHY_NODE_CHILD_ADDED,
207 (EphyNodeCallback)node_added_cb,
208 G_OBJECT (window));
209
210 ephy_node_signal_connect_object (bookmarks, EPHY_NODE_CHILD_REMOVED,
211 (EphyNodeCallback)node_removed_cb,
212 G_OBJECT (window));
213 ephy_node_signal_connect_object (topics, EPHY_NODE_CHILD_REMOVED,
214 (EphyNodeCallback)node_removed_cb,
215 G_OBJECT (window));
216
217 ephy_node_signal_connect_object (bookmarks, EPHY_NODE_CHILD_CHANGED,
218 (EphyNodeCallback)node_changed_cb,
219 G_OBJECT (window));
220 ephy_node_signal_connect_object (topics, EPHY_NODE_CHILD_CHANGED,
221 (EphyNodeCallback)node_changed_cb,
222 G_OBJECT (window));
223
224 g_signal_connect_object (eb, "tree_changed",
225 G_CALLBACK (tree_changed_cb),
226 G_OBJECT (window), 0);
227
228 /* Setup empty menu strings and add signal handlers to build the menus on demand */
229 if (!bookmarks_menu_string)
230 bookmarks_menu_string = g_string_new ("");
231
232 action = find_action (manager, "Bookmarks");
233 g_signal_connect_object (action, "activate",
234 G_CALLBACK (activate_bookmarks_menu),
235 G_OBJECT (window), 0);
236}
237
238void
239ephy_bookmarks_ui_detach_window (EphyWindow *window)
240{
241 EphyBookmarks *eb = ephy_shell_get_bookmarks (ephy_shell_get_default ());
242 EphyNode *bookmarks = ephy_bookmarks_get_bookmarks (eb);
243 EphyNode *topics = ephy_bookmarks_get_keywords (eb);
244
245 BookmarksWindowData *data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
246 GtkUIManager *manager = ephy_window_get_ui_manager (window);
247 GtkAction *action;
248
249 g_return_if_fail (data != 0);
250
251 if (data->bookmarks_menu)
252 gtk_ui_manager_remove_ui (manager, data->bookmarks_menu);
253
254 g_object_set_data (G_OBJECT (window), BM_WINDOW_DATA_KEY, 0);
255
256 ephy_node_signal_disconnect_object (bookmarks, EPHY_NODE_CHILD_ADDED,
257 (EphyNodeCallback)node_added_cb,
258 G_OBJECT (window));
259 ephy_node_signal_disconnect_object (topics, EPHY_NODE_CHILD_ADDED,
260 (EphyNodeCallback)node_added_cb,
261 G_OBJECT (window));
262
263 ephy_node_signal_disconnect_object (bookmarks, EPHY_NODE_CHILD_REMOVED,
264 (EphyNodeCallback)node_removed_cb,
265 G_OBJECT (window));
266 ephy_node_signal_disconnect_object (topics, EPHY_NODE_CHILD_REMOVED,
267 (EphyNodeCallback)node_removed_cb,
268 G_OBJECT (window));
269
270 ephy_node_signal_disconnect_object (bookmarks, EPHY_NODE_CHILD_CHANGED,
271 (EphyNodeCallback)node_changed_cb,
272 G_OBJECT (window));
273 ephy_node_signal_disconnect_object (topics, EPHY_NODE_CHILD_CHANGED,
274 (EphyNodeCallback)node_changed_cb,
275 G_OBJECT (window));
276
277 g_signal_handlers_disconnect_by_func
278 (G_OBJECT (eb), G_CALLBACK (tree_changed_cb), G_OBJECT (window));
279
280 action = find_action (manager, "Bookmarks");
281 g_signal_handlers_disconnect_by_func
282 (G_OBJECT (action), G_CALLBACK (activate_bookmarks_menu), G_OBJECT (window));
283}
284
285static void
286properties_dialog_destroy_cb (EphyBookmarkProperties *dialog,
287 EphyNode *bookmark)
288{
289 g_hash_table_remove (properties_dialogs, bookmark);
290}
291
292void
293ephy_bookmarks_ui_add_bookmark (GtkWindow *parent,
294 const char *location,
295 const char *title)
296{
297 EphyBookmarks *bookmarks;
298 EphyNode *bookmark;
299 GtkWidget *dialog;
300
301 if (g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN,
302 EPHY_PREFS_LOCKDOWN_BOOKMARK_EDITING))
303 return;
304
305 bookmarks = ephy_shell_get_bookmarks (ephy_shell_get_default ());
306 bookmark = ephy_bookmarks_add (bookmarks, title, location);
307
308 if (properties_dialogs == 0)
309 {
310 properties_dialogs = g_hash_table_new (g_direct_hash, g_direct_equal);
311 }
312
313 dialog = ephy_bookmark_properties_new (bookmarks, bookmark, TRUE);
314
315 g_assert (parent != NULL);
316
317 gtk_window_group_add_window (ephy_gui_ensure_window_group (parent),
318 GTK_WINDOW (dialog));
319 gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
320
321 g_signal_connect (dialog, "destroy",
322 G_CALLBACK (properties_dialog_destroy_cb), bookmark);
323 g_hash_table_insert (properties_dialogs,
324 bookmark, dialog);
325
326 gtk_window_present_with_time (GTK_WINDOW (dialog),
327 gtk_get_current_event_time ());
328}
329
330void
331ephy_bookmarks_ui_show_bookmark (EphyNode *bookmark)
332{
333 EphyBookmarks *bookmarks;
334 GtkWidget *dialog;
335
336 bookmarks = ephy_shell_get_bookmarks (ephy_shell_get_default ());
337
338 g_return_if_fail (EPHY_IS_BOOKMARKS (bookmarks));
339 g_return_if_fail (EPHY_IS_NODE (bookmark));
340
341 if (properties_dialogs == 0)
342 {
343 properties_dialogs = g_hash_table_new (g_direct_hash, g_direct_equal);
344 }
345
346 dialog = g_hash_table_lookup (properties_dialogs, bookmark);
347
348 if (dialog == NULL)
349 {
350 dialog = ephy_bookmark_properties_new (bookmarks, bookmark, FALSE);
351
352 g_signal_connect (dialog, "destroy",
353 G_CALLBACK (properties_dialog_destroy_cb), bookmark);
354 g_hash_table_insert (properties_dialogs,
355 bookmark, dialog);
356 }
357
358 gtk_window_present_with_time (GTK_WINDOW (dialog),
359 gtk_get_current_event_time ());
360}
361
362
363
0364
=== removed file '.pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks/ephy-bookmarks-ui.c'
--- .pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks/ephy-bookmarks-ui.c 2013-11-13 11:39:29 +0000
+++ .pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks/ephy-bookmarks-ui.c 1970-01-01 00:00:00 +0000
@@ -1,363 +0,0 @@
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2/*
3 * Copyright © 2005 Peter Harvey
4 * Copyright © 2006 Christian Persch
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 *
20 */
21
22#include "config.h"
23#include "ephy-bookmarks-ui.h"
24
25#include "ephy-bookmark-action-group.h"
26#include "ephy-bookmark-action.h"
27#include "ephy-bookmark-properties.h"
28#include "ephy-bookmarks-menu.h"
29#include "ephy-bookmarks.h"
30#include "ephy-debug.h"
31#include "ephy-dnd.h"
32#include "ephy-embed-shell.h"
33#include "ephy-file-helpers.h"
34#include "ephy-gui.h"
35#include "ephy-link.h"
36#include "ephy-node-common.h"
37#include "ephy-open-tabs-action.h"
38#include "ephy-prefs.h"
39#include "ephy-settings.h"
40#include "ephy-shell.h"
41#include "ephy-string.h"
42#include "ephy-topic-action-group.h"
43#include "ephy-topic-action.h"
44
45#include <string.h>
46#include <glib/gi18n.h>
47#include <gtk/gtk.h>
48
49#define BM_WINDOW_DATA_KEY "bookmarks-window-data"
50
51typedef struct
52{
53 guint bookmarks_menu;
54 guint toolbar_menu;
55} BookmarksWindowData;
56
57enum
58{
59 RESPONSE_SHOW_PROPERTIES = 1,
60 RESPONSE_NEW_BOOKMARK = 2
61};
62
63static GString * bookmarks_menu_string = 0;
64static GHashTable *properties_dialogs = 0;
65
66static GtkAction *
67find_action (GtkUIManager *manager, const char *name)
68{
69 GList *l = gtk_ui_manager_get_action_groups (manager);
70 GtkAction *action;
71
72 while (l != NULL)
73 {
74 action = gtk_action_group_get_action (GTK_ACTION_GROUP (l->data), name);
75 if (action) return action;
76 l = l->next;
77 }
78
79 return NULL;
80}
81
82static void
83activate_bookmarks_menu (GtkAction *action, EphyWindow *window)
84{
85 BookmarksWindowData *data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
86 if (data && !data->bookmarks_menu)
87 {
88 GtkUIManager *manager = ephy_window_get_ui_manager (window);
89 gtk_ui_manager_ensure_update (manager);
90
91 if (!bookmarks_menu_string->len)
92 {
93 g_string_append (bookmarks_menu_string,
94 "<ui><popup name=\"PagePopup\" action=\"PagePopupAction\"><menu name=\"BookmarksMenu\" action=\"Bookmarks\">");
95 ephy_bookmarks_menu_build (bookmarks_menu_string, 0);
96 g_string_append (bookmarks_menu_string, "</menu></popup></ui>");
97 }
98
99 data->bookmarks_menu = gtk_ui_manager_add_ui_from_string
100 (manager, bookmarks_menu_string->str, bookmarks_menu_string->len, 0);
101
102 gtk_ui_manager_ensure_update (manager);
103 }
104}
105
106static void
107erase_bookmarks_menu (EphyWindow *window)
108{
109 BookmarksWindowData *data;
110 GtkUIManager *manager;
111
112 manager = ephy_window_get_ui_manager (window);
113 data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
114
115 if (data != NULL && data->bookmarks_menu != 0)
116 {
117 gtk_ui_manager_remove_ui (manager, data->bookmarks_menu);
118 data->bookmarks_menu = 0;
119 }
120
121 g_string_truncate (bookmarks_menu_string, 0);
122}
123
124static void
125tree_changed_cb (EphyBookmarks *bookmarks,
126 EphyWindow *window)
127{
128 erase_bookmarks_menu (window);
129}
130
131static void
132node_added_cb (EphyNode *parent,
133 EphyNode *child,
134 EphyWindow *window)
135{
136 erase_bookmarks_menu (window);
137}
138
139static void
140node_changed_cb (EphyNode *parent,
141 EphyNode *child,
142 guint property_id,
143 EphyWindow *window)
144{
145 if (property_id == EPHY_NODE_KEYWORD_PROP_NAME ||
146 property_id == EPHY_NODE_BMK_PROP_TITLE)
147 {
148 erase_bookmarks_menu (window);
149 }
150}
151
152static void
153node_removed_cb (EphyNode *parent,
154 EphyNode *child,
155 guint index,
156 EphyWindow *window)
157{
158 erase_bookmarks_menu (window);
159}
160
161void
162ephy_bookmarks_ui_attach_window (EphyWindow *window)
163{
164 EphyBookmarks *eb;
165 EphyNode *bookmarks;
166 EphyNode *topics;
167 BookmarksWindowData *data;
168 GtkUIManager *manager;
169 GtkActionGroup *actions;
170 GtkAction *action;
171
172 eb = ephy_shell_get_bookmarks (ephy_shell_get_default ());
173 bookmarks = ephy_bookmarks_get_bookmarks (eb);
174 topics = ephy_bookmarks_get_keywords (eb);
175 data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
176 g_return_if_fail (data == NULL);
177
178 manager = ephy_window_get_ui_manager (window);
179
180 data = g_new0 (BookmarksWindowData, 1);
181 g_object_set_data_full (G_OBJECT (window), BM_WINDOW_DATA_KEY, data, g_free);
182
183 /* Create the self-maintaining action groups for bookmarks and topics */
184 actions = ephy_bookmark_group_new (bookmarks);
185 gtk_ui_manager_insert_action_group (manager, actions, -1);
186 g_signal_connect_object (actions, "open-link",
187 G_CALLBACK (ephy_link_open), G_OBJECT (window),
188 G_CONNECT_SWAPPED | G_CONNECT_AFTER);
189 g_object_unref (actions);
190
191 actions = ephy_topic_action_group_new (topics, manager);
192 gtk_ui_manager_insert_action_group (manager, actions, -1);
193 g_object_unref (actions);
194
195 actions = ephy_open_tabs_group_new (topics);
196 gtk_ui_manager_insert_action_group (manager, actions, -1);
197 g_signal_connect_object (actions, "open-link",
198 G_CALLBACK (ephy_link_open), G_OBJECT (window),
199 G_CONNECT_SWAPPED | G_CONNECT_AFTER);
200 g_object_unref (actions);
201
202 /* Add signal handlers for the bookmark database */
203 ephy_node_signal_connect_object (bookmarks, EPHY_NODE_CHILD_ADDED,
204 (EphyNodeCallback)node_added_cb,
205 G_OBJECT (window));
206 ephy_node_signal_connect_object (topics, EPHY_NODE_CHILD_ADDED,
207 (EphyNodeCallback)node_added_cb,
208 G_OBJECT (window));
209
210 ephy_node_signal_connect_object (bookmarks, EPHY_NODE_CHILD_REMOVED,
211 (EphyNodeCallback)node_removed_cb,
212 G_OBJECT (window));
213 ephy_node_signal_connect_object (topics, EPHY_NODE_CHILD_REMOVED,
214 (EphyNodeCallback)node_removed_cb,
215 G_OBJECT (window));
216
217 ephy_node_signal_connect_object (bookmarks, EPHY_NODE_CHILD_CHANGED,
218 (EphyNodeCallback)node_changed_cb,
219 G_OBJECT (window));
220 ephy_node_signal_connect_object (topics, EPHY_NODE_CHILD_CHANGED,
221 (EphyNodeCallback)node_changed_cb,
222 G_OBJECT (window));
223
224 g_signal_connect_object (eb, "tree_changed",
225 G_CALLBACK (tree_changed_cb),
226 G_OBJECT (window), 0);
227
228 /* Setup empty menu strings and add signal handlers to build the menus on demand */
229 if (!bookmarks_menu_string)
230 bookmarks_menu_string = g_string_new ("");
231
232 action = find_action (manager, "Bookmarks");
233 g_signal_connect_object (action, "activate",
234 G_CALLBACK (activate_bookmarks_menu),
235 G_OBJECT (window), 0);
236}
237
238void
239ephy_bookmarks_ui_detach_window (EphyWindow *window)
240{
241 EphyBookmarks *eb = ephy_shell_get_bookmarks (ephy_shell_get_default ());
242 EphyNode *bookmarks = ephy_bookmarks_get_bookmarks (eb);
243 EphyNode *topics = ephy_bookmarks_get_keywords (eb);
244
245 BookmarksWindowData *data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
246 GtkUIManager *manager = ephy_window_get_ui_manager (window);
247 GtkAction *action;
248
249 g_return_if_fail (data != 0);
250
251 if (data->bookmarks_menu)
252 gtk_ui_manager_remove_ui (manager, data->bookmarks_menu);
253
254 g_object_set_data (G_OBJECT (window), BM_WINDOW_DATA_KEY, 0);
255
256 ephy_node_signal_disconnect_object (bookmarks, EPHY_NODE_CHILD_ADDED,
257 (EphyNodeCallback)node_added_cb,
258 G_OBJECT (window));
259 ephy_node_signal_disconnect_object (topics, EPHY_NODE_CHILD_ADDED,
260 (EphyNodeCallback)node_added_cb,
261 G_OBJECT (window));
262
263 ephy_node_signal_disconnect_object (bookmarks, EPHY_NODE_CHILD_REMOVED,
264 (EphyNodeCallback)node_removed_cb,
265 G_OBJECT (window));
266 ephy_node_signal_disconnect_object (topics, EPHY_NODE_CHILD_REMOVED,
267 (EphyNodeCallback)node_removed_cb,
268 G_OBJECT (window));
269
270 ephy_node_signal_disconnect_object (bookmarks, EPHY_NODE_CHILD_CHANGED,
271 (EphyNodeCallback)node_changed_cb,
272 G_OBJECT (window));
273 ephy_node_signal_disconnect_object (topics, EPHY_NODE_CHILD_CHANGED,
274 (EphyNodeCallback)node_changed_cb,
275 G_OBJECT (window));
276
277 g_signal_handlers_disconnect_by_func
278 (G_OBJECT (eb), G_CALLBACK (tree_changed_cb), G_OBJECT (window));
279
280 action = find_action (manager, "Bookmarks");
281 g_signal_handlers_disconnect_by_func
282 (G_OBJECT (action), G_CALLBACK (activate_bookmarks_menu), G_OBJECT (window));
283}
284
285static void
286properties_dialog_destroy_cb (EphyBookmarkProperties *dialog,
287 EphyNode *bookmark)
288{
289 g_hash_table_remove (properties_dialogs, bookmark);
290}
291
292void
293ephy_bookmarks_ui_add_bookmark (GtkWindow *parent,
294 const char *location,
295 const char *title)
296{
297 EphyBookmarks *bookmarks;
298 EphyNode *bookmark;
299 GtkWidget *dialog;
300
301 if (g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN,
302 EPHY_PREFS_LOCKDOWN_BOOKMARK_EDITING))
303 return;
304
305 bookmarks = ephy_shell_get_bookmarks (ephy_shell_get_default ());
306 bookmark = ephy_bookmarks_add (bookmarks, title, location);
307
308 if (properties_dialogs == 0)
309 {
310 properties_dialogs = g_hash_table_new (g_direct_hash, g_direct_equal);
311 }
312
313 dialog = ephy_bookmark_properties_new (bookmarks, bookmark, TRUE);
314
315 g_assert (parent != NULL);
316
317 gtk_window_group_add_window (ephy_gui_ensure_window_group (parent),
318 GTK_WINDOW (dialog));
319 gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
320
321 g_signal_connect (dialog, "destroy",
322 G_CALLBACK (properties_dialog_destroy_cb), bookmark);
323 g_hash_table_insert (properties_dialogs,
324 bookmark, dialog);
325
326 gtk_window_present_with_time (GTK_WINDOW (dialog),
327 gtk_get_current_event_time ());
328}
329
330void
331ephy_bookmarks_ui_show_bookmark (EphyNode *bookmark)
332{
333 EphyBookmarks *bookmarks;
334 GtkWidget *dialog;
335
336 bookmarks = ephy_shell_get_bookmarks (ephy_shell_get_default ());
337
338 g_return_if_fail (EPHY_IS_BOOKMARKS (bookmarks));
339 g_return_if_fail (EPHY_IS_NODE (bookmark));
340
341 if (properties_dialogs == 0)
342 {
343 properties_dialogs = g_hash_table_new (g_direct_hash, g_direct_equal);
344 }
345
346 dialog = g_hash_table_lookup (properties_dialogs, bookmark);
347
348 if (dialog == NULL)
349 {
350 dialog = ephy_bookmark_properties_new (bookmarks, bookmark, FALSE);
351
352 g_signal_connect (dialog, "destroy",
353 G_CALLBACK (properties_dialog_destroy_cb), bookmark);
354 g_hash_table_insert (properties_dialogs,
355 bookmark, dialog);
356 }
357
358 gtk_window_present_with_time (GTK_WINDOW (dialog),
359 gtk_get_current_event_time ());
360}
361
362
363
3640
=== added file '.pc/applied-patches'
--- .pc/applied-patches 1970-01-01 00:00:00 +0000
+++ .pc/applied-patches 2015-07-11 21:08:34 +0000
@@ -0,0 +1,5 @@
100_epiphany-browser.patch
207_bookmarks.patch
312_safetypes.patch
481_ubuntu_force_update_bookmarks_menu.patch
5ubuntu_titlebars.patch
06
=== removed file '.pc/applied-patches'
--- .pc/applied-patches 2014-12-21 10:19:27 +0000
+++ .pc/applied-patches 1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
100_epiphany-browser.patch
207_bookmarks.patch
312_safetypes.patch
481_ubuntu_force_update_bookmarks_menu.patch
5ubuntu_titlebars.patch
60
=== added directory '.pc/ubuntu_titlebars.patch'
=== removed directory '.pc/ubuntu_titlebars.patch'
=== added file '.pc/ubuntu_titlebars.patch/.timestamp'
=== added directory '.pc/ubuntu_titlebars.patch/src'
=== removed directory '.pc/ubuntu_titlebars.patch/src'
=== added file '.pc/ubuntu_titlebars.patch/src/ephy-window.c'
--- .pc/ubuntu_titlebars.patch/src/ephy-window.c 1970-01-01 00:00:00 +0000
+++ .pc/ubuntu_titlebars.patch/src/ephy-window.c 2015-07-11 21:08:34 +0000
@@ -0,0 +1,4026 @@
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2/*
3 * Copyright © 2000, 2001, 2002, 2003, 2004 Marco Pesenti Gritti
4 * Copyright © 2003, 2004 Christian Persch
5 * Copyright © 2011 Igalia S.L.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *
21 */
22
23#include "config.h"
24#include "ephy-window.h"
25
26#include "ephy-action-helper.h"
27#include "ephy-bookmarks-ui.h"
28#include "ephy-certificate-popover.h"
29#include "ephy-combined-stop-reload-action.h"
30#include "ephy-debug.h"
31#include "ephy-download-widget.h"
32#include "ephy-embed-container.h"
33#include "ephy-embed-prefs.h"
34#include "ephy-embed-shell.h"
35#include "ephy-embed-type-builtins.h"
36#include "ephy-embed-utils.h"
37#include "ephy-encoding-menu.h"
38#include "ephy-file-helpers.h"
39#include "ephy-find-toolbar.h"
40#include "ephy-gui.h"
41#include "ephy-home-action.h"
42#include "ephy-initial-state.h"
43#include "ephy-link.h"
44#include "ephy-location-entry.h"
45#include "ephy-navigation-history-action.h"
46#include "ephy-notebook.h"
47#include "ephy-prefs.h"
48#include "ephy-private.h"
49#include "ephy-session.h"
50#include "ephy-settings.h"
51#include "ephy-shell.h"
52#include "ephy-title-box.h"
53#include "ephy-toolbar.h"
54#include "ephy-type-builtins.h"
55#include "ephy-web-view.h"
56#include "ephy-zoom-action.h"
57#include "ephy-zoom.h"
58#include "popup-commands.h"
59#include "window-commands.h"
60
61#include <gdk/gdkkeysyms.h>
62#include <gdk/gdkx.h>
63#include <gio/gio.h>
64#include <glib/gi18n.h>
65#include <gtk/gtk.h>
66#include <libsoup/soup.h>
67
68#define WNCK_I_KNOW_THIS_IS_UNSTABLE
69#include <libwnck/libwnck.h>
70
71#include <webkit2/webkit2.h>
72
73#ifdef HAVE_X11_XF86KEYSYM_H
74#include <X11/XF86keysym.h>
75#endif
76
77/**
78 * SECTION:ephy-window
79 * @short_description: Epiphany's main #GtkWindow widget
80 *
81 * #EphyWindow is Epiphany's main widget.
82 */
83
84static void ephy_window_view_popup_windows_cb (GtkAction *action,
85 EphyWindow *window);
86
87static const GtkActionEntry ephy_menu_entries [] = {
88
89 /* Toplevel */
90
91 { "Bookmarks", NULL, N_("_Bookmarks") },
92 { "PopupAction", NULL, "" },
93 { "PagePopupAction", NULL, "" },
94 { "NotebookPopupAction", NULL, "" },
95
96 /* File actions. */
97
98 { "FileNewWindow", NULL, N_("_New Window"), "<control>N", NULL,
99 G_CALLBACK (window_cmd_file_new_window) },
100 { "FileNewWindowIncognito", NULL, N_("New _Incognito Window"), "<control><shift>N", NULL,
101 G_CALLBACK (window_cmd_file_new_incognito_window) },
102 { "FileOpen", NULL, N_("_Open…"), "<control>O", NULL,
103 G_CALLBACK (window_cmd_file_open) },
104 { "FileSaveAs", NULL, N_("Save _As…"), "<shift><control>S", NULL,
105 G_CALLBACK (window_cmd_file_save_as) },
106 { "FileSaveAsApplication", NULL, N_("Save As _Web Application…"), "<shift><control>A", NULL,
107 G_CALLBACK (window_cmd_file_save_as_application) },
108 { "FilePrint", NULL, N_("_Print…"), "<control>P", NULL,
109 G_CALLBACK (window_cmd_file_print) },
110 { "FileSendTo", NULL, N_("S_end Link by Email…"), NULL, NULL,
111 G_CALLBACK (window_cmd_file_send_to) },
112 { "FileCloseTab", NULL, N_("_Close"), "<control>W", NULL,
113 G_CALLBACK (window_cmd_file_close_window) },
114 { "FileQuit", NULL, N_("_Quit"), "<control>Q", NULL,
115 G_CALLBACK (window_cmd_file_quit) },
116
117 /* Edit actions. */
118
119 { "EditUndo", NULL, N_("_Undo"), "<control>Z", NULL,
120 G_CALLBACK (window_cmd_edit_undo) },
121 { "EditRedo", NULL, N_("Re_do"), "<shift><control>Z", NULL,
122 G_CALLBACK (window_cmd_edit_redo) },
123 { "EditCut", NULL, N_("Cu_t"), "<control>X", NULL,
124 G_CALLBACK (window_cmd_edit_cut) },
125 { "EditCopy", NULL, N_("_Copy"), "<control>C", NULL,
126 G_CALLBACK (window_cmd_edit_copy) },
127 { "EditPaste", NULL, N_("_Paste"), "<control>V", NULL,
128 G_CALLBACK (window_cmd_edit_paste) },
129 { "EditDelete", NULL, NULL, NULL, NULL,
130 G_CALLBACK (window_cmd_edit_delete) },
131 { "EditSelectAll", NULL, N_("Select _All"), "<control>A", NULL,
132 G_CALLBACK (window_cmd_edit_select_all) },
133 { "EditFind", NULL, N_("_Find…"), "<control>F", NULL,
134 G_CALLBACK (window_cmd_edit_find) },
135 { "EditFindNext", NULL, N_("Find Ne_xt"), "<control>G", NULL,
136 G_CALLBACK (window_cmd_edit_find_next) },
137 { "EditFindPrev", NULL, N_("Find Pre_vious"), "<shift><control>G", NULL,
138 G_CALLBACK (window_cmd_edit_find_prev) },
139 { "EditBookmarks", NULL, N_("Edit _Bookmarks"), "<control>B", NULL,
140 G_CALLBACK (window_cmd_edit_bookmarks) },
141 { "EditHistory", NULL, N_("_History"), "<control>H", NULL,
142 G_CALLBACK (window_cmd_edit_history) },
143 { "EditPreferences", NULL, N_("Pr_eferences"), "<control>e", NULL,
144 G_CALLBACK (window_cmd_edit_preferences) },
145
146 /* View actions. */
147
148 { "ViewStop", NULL, N_("_Stop"), "Escape", NULL,
149 G_CALLBACK (window_cmd_view_stop) },
150 { "ViewAlwaysStop", NULL, N_("_Stop"), "Escape",
151 NULL, G_CALLBACK (window_cmd_view_stop) },
152 { "ViewReload", NULL, N_("_Reload"), "<control>R", NULL,
153 G_CALLBACK (window_cmd_view_reload) },
154 { "ViewZoomIn", NULL, N_("Zoom _In"), "<control>plus", NULL,
155 G_CALLBACK (window_cmd_view_zoom_in) },
156 { "ViewZoomOut", NULL, N_("Zoom O_ut"), "<control>minus", NULL,
157 G_CALLBACK (window_cmd_view_zoom_out) },
158 { "ViewZoomNormal", NULL, N_("_Normal Size"), "<control>0", NULL,
159 G_CALLBACK (window_cmd_view_zoom_normal) },
160 { "ViewEncoding", NULL, N_("Text _Encoding"), NULL, NULL, NULL },
161 { "ViewPageSource", NULL, N_("_Page Source"), "<control>U", NULL,
162 G_CALLBACK (window_cmd_view_page_source) },
163
164 /* Bookmarks actions. */
165
166 { "FileBookmarkPage", NULL, N_("_Add Bookmark…"), "<control>D", NULL,
167 G_CALLBACK (window_cmd_file_bookmark_page) },
168
169 /* Go actions. */
170
171 { "GoLocation", NULL, N_("_Location…"), "<control>L", NULL,
172 G_CALLBACK (window_cmd_go_location) },
173
174 /* Tabs actions. */
175
176 { "TabsPrevious", NULL, N_("_Previous Tab"), "<control>Page_Up", NULL,
177 G_CALLBACK (window_cmd_tabs_previous) },
178 { "TabsNext", NULL, N_("_Next Tab"), "<control>Page_Down", NULL,
179 G_CALLBACK (window_cmd_tabs_next) },
180 { "TabsMoveLeft", NULL, N_("Move Tab _Left"), "<shift><control>Page_Up", NULL,
181 G_CALLBACK (window_cmd_tabs_move_left) },
182 { "TabsMoveRight", NULL, N_("Move Tab _Right"), "<shift><control>Page_Down", NULL,
183 G_CALLBACK (window_cmd_tabs_move_right) },
184 { "TabsDetach", NULL, N_("_Detach Tab"), NULL, NULL,
185 G_CALLBACK (window_cmd_tabs_detach) },
186
187 /* Help. */
188
189 { "HelpContents", NULL, N_("_Help"), NULL, NULL,
190 G_CALLBACK (window_cmd_help_contents) },
191 { "HelpAbout", NULL, N_("_About"), NULL, NULL,
192 G_CALLBACK (window_cmd_help_about) }
193};
194
195static const GtkToggleActionEntry ephy_menu_toggle_entries [] =
196{
197 /* View actions. */
198
199 { "ViewDownloadsBar", NULL, N_("_Downloads Bar"), NULL, NULL,
200 NULL, FALSE },
201
202 { "ViewFullscreen", NULL, N_("_Fullscreen"), "F11", NULL,
203 G_CALLBACK (window_cmd_view_fullscreen), FALSE },
204 { "ViewPopupWindows", NULL, N_("Popup _Windows"), NULL, NULL,
205 G_CALLBACK (ephy_window_view_popup_windows_cb), FALSE },
206 { "BrowseWithCaret", NULL, N_("Selection Caret"), "F7", NULL,
207 G_CALLBACK (window_cmd_browse_with_caret), FALSE }
208};
209
210static const GtkActionEntry ephy_popups_entries [] = {
211 /* Document. */
212
213 { "ContextBookmarkPage", NULL, N_("Add Boo_kmark…"), "<control>D", NULL,
214 G_CALLBACK (window_cmd_file_bookmark_page) },
215
216 /* Links. */
217
218 { "OpenLinkInNewWindow", NULL, N_("Open Link in New _Window"), NULL, NULL,
219 G_CALLBACK (popup_cmd_link_in_new_window) },
220 { "OpenLinkInNewTab", NULL, N_("Open Link in New _Tab"), NULL, NULL,
221 G_CALLBACK (popup_cmd_link_in_new_tab) },
222 { "DownloadLinkAs", NULL, N_("_Save Link As…"), NULL, NULL,
223 G_CALLBACK (popup_cmd_download_link_as) },
224 { "CopyLinkAddress", NULL, N_("_Copy Link Address"), NULL,
225 NULL, G_CALLBACK (popup_cmd_copy_link_address) },
226 { "CopyEmailAddress", NULL, N_("_Copy E-mail Address"), NULL,
227 NULL, G_CALLBACK (popup_cmd_copy_link_address) },
228
229 /* Images. */
230
231 { "ViewImage", NULL, N_("View _Image in New Tab"), NULL,
232 NULL, G_CALLBACK (popup_cmd_view_image_in_new_tab) },
233 { "CopyImageLocation", NULL, N_("Copy I_mage Address"), NULL,
234 NULL, G_CALLBACK (popup_cmd_copy_image_location) },
235 { "SaveImageAs", NULL, N_("_Save Image As…"), NULL,
236 NULL, G_CALLBACK (popup_cmd_save_image_as) },
237 { "SetImageAsBackground", NULL, N_("Set as _Wallpaper"), NULL,
238 NULL, G_CALLBACK (popup_cmd_set_image_as_background) },
239
240 /* Video. */
241
242 { "OpenVideoInNewWindow", NULL, N_("Open Video in New _Window"), NULL, NULL,
243 G_CALLBACK (popup_cmd_media_in_new_window) },
244 { "OpenVideoInNewTab", NULL, N_("Open Video in New _Tab"), NULL, NULL,
245 G_CALLBACK (popup_cmd_media_in_new_tab) },
246 { "SaveVideoAs", NULL, N_("_Save Video As…"), NULL,
247 NULL, G_CALLBACK (popup_cmd_save_media_as) },
248 { "CopyVideoLocation", NULL, N_("_Copy Video Address"), NULL,
249 NULL, G_CALLBACK (popup_cmd_copy_media_location) },
250
251 /* Audio. */
252
253 { "OpenAudioInNewWindow", NULL, N_("Open Audio in New _Window"), NULL, NULL,
254 G_CALLBACK (popup_cmd_media_in_new_window) },
255 { "OpenAudioInNewTab", NULL, N_("Open Audio in New _Tab"), NULL, NULL,
256 G_CALLBACK (popup_cmd_media_in_new_tab) },
257 { "SaveAudioAs", NULL, N_("_Save Audio As…"), NULL,
258 NULL, G_CALLBACK (popup_cmd_save_media_as) },
259 { "CopyAudioLocation", NULL, N_("_Copy Audio Address"), NULL,
260 NULL, G_CALLBACK (popup_cmd_copy_media_location) },
261};
262
263static const struct
264{
265 guint keyval;
266 GdkModifierType modifier;
267 const gchar *action;
268 gboolean fromToolbar;
269} extra_keybindings [] = {
270 /* FIXME: PageMenu should have its accel without being in the
271 * extra keybindings, but does not seem to work for some
272 * reason. */
273 { GDK_KEY_F10, 0, "PageMenu", TRUE },
274 { GDK_KEY_Home, GDK_MOD1_MASK, "FileHome", TRUE },
275 /* FIXME: these are not in any menu for now, so add them here. */
276 { GDK_KEY_F11, 0, "ViewFullscreen", FALSE },
277 { GDK_KEY_plus, GDK_CONTROL_MASK, "ViewZoomIn", FALSE },
278 { GDK_KEY_minus, GDK_CONTROL_MASK, "ViewZoomOut", FALSE },
279 { GDK_KEY_0, GDK_CONTROL_MASK, "ViewZoomNormal", FALSE },
280 { GDK_KEY_g, GDK_CONTROL_MASK, "EditFindNext", FALSE },
281 { GDK_KEY_G, GDK_CONTROL_MASK |
282 GDK_SHIFT_MASK, "EditFindPrev", FALSE },
283
284 { GDK_KEY_s, GDK_CONTROL_MASK, "FileSaveAs", FALSE },
285 { GDK_KEY_r, GDK_CONTROL_MASK, "ViewReload", FALSE },
286 { GDK_KEY_R, GDK_CONTROL_MASK, "ViewReload", FALSE },
287 { GDK_KEY_R, GDK_CONTROL_MASK |
288 GDK_SHIFT_MASK, "ViewReload", FALSE },
289 /* Tab navigation */
290 { GDK_KEY_Page_Up, GDK_CONTROL_MASK, "TabsPrevious", FALSE },
291 { GDK_KEY_Page_Down, GDK_CONTROL_MASK, "TabsNext", FALSE },
292 { GDK_KEY_Page_Up, GDK_CONTROL_MASK |
293 GDK_SHIFT_MASK, "TabsMoveLeft", FALSE },
294 { GDK_KEY_Page_Down, GDK_CONTROL_MASK |
295 GDK_SHIFT_MASK, "TabsMoveRight", FALSE },
296 /* Go */
297 { GDK_KEY_l, GDK_CONTROL_MASK, "GoLocation", FALSE },
298 { GDK_KEY_F6, 0, "GoLocation", FALSE },
299 /* Support all the MSIE tricks as well ;) */
300 { GDK_KEY_F5, 0, "ViewReload", FALSE },
301 { GDK_KEY_F5, GDK_CONTROL_MASK, "ViewReload", FALSE },
302 { GDK_KEY_F5, GDK_SHIFT_MASK, "ViewReload", FALSE },
303 { GDK_KEY_F5, GDK_CONTROL_MASK |
304 GDK_SHIFT_MASK, "ViewReload", FALSE },
305 { GDK_KEY_KP_Add, GDK_CONTROL_MASK, "ViewZoomIn", FALSE },
306 { GDK_KEY_KP_Subtract, GDK_CONTROL_MASK, "ViewZoomOut", FALSE },
307 { GDK_KEY_equal, GDK_CONTROL_MASK, "ViewZoomIn", FALSE },
308 { GDK_KEY_KP_0, GDK_CONTROL_MASK, "ViewZoomNormal", FALSE },
309 /* These keys are a bit strange: when pressed with no modifiers, they emit
310 * KP_PageUp/Down Control; when pressed with Control+Shift they are KP_9/3,
311 * when NumLock is on they are KP_9/3 and with NumLock and Control+Shift
312 * They're KP_PageUp/Down again!
313 */
314 { GDK_KEY_Left, GDK_MOD1_MASK /*Alt*/, "NavigationBack", TRUE },
315 { GDK_KEY_KP_Left, GDK_MOD1_MASK /*Alt*/, "NavigationBack", TRUE },
316 { GDK_KEY_KP_4, GDK_MOD1_MASK /*Alt*/, "NavigationBack", TRUE },
317 { GDK_KEY_Right, GDK_MOD1_MASK /*Alt*/, "NavigationForward", TRUE },
318 { GDK_KEY_KP_Right, GDK_MOD1_MASK /*Alt*/, "NavigationForward", TRUE },
319 { GDK_KEY_KP_6, GDK_MOD1_MASK /*Alt*/, "NavigationForward", TRUE },
320 { GDK_KEY_KP_Page_Up, GDK_CONTROL_MASK, "TabsPrevious", FALSE },
321 { GDK_KEY_KP_9, GDK_CONTROL_MASK, "TabsPrevious", FALSE },
322 { GDK_KEY_KP_Page_Down, GDK_CONTROL_MASK, "TabsNext", FALSE },
323 { GDK_KEY_KP_3, GDK_CONTROL_MASK, "TabsNext", FALSE },
324 { GDK_KEY_KP_Page_Up, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "TabsMoveLeft", FALSE },
325 { GDK_KEY_KP_9, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "TabsMoveLeft", FALSE },
326 { GDK_KEY_KP_Page_Down, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "TabsMoveRight", FALSE },
327 { GDK_KEY_KP_3, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "TabsMoveRight", FALSE },
328#ifdef HAVE_X11_XF86KEYSYM_H
329 { XF86XK_Back, 0, "NavigationBack", TRUE },
330 { XF86XK_Forward, 0, "NavigationForward", TRUE },
331 { XF86XK_Go, 0, "GoLocation", FALSE },
332 { XF86XK_OpenURL, 0, "GoLocation", FALSE },
333 { XF86XK_AddFavorite, 0, "FileBookmarkPage", FALSE },
334 { XF86XK_Refresh, 0, "ViewReload", FALSE },
335 { XF86XK_Reload, 0, "ViewReload", FALSE },
336 { XF86XK_Search, 0, "EditFind", FALSE },
337 { XF86XK_Send, 0, "FileSendTo", FALSE },
338 { XF86XK_Stop, 0, "ViewStop", FALSE },
339 { XF86XK_ZoomIn, 0, "ViewZoomIn", FALSE },
340 { XF86XK_ZoomOut, 0, "ViewZoomOut", FALSE }
341 /* FIXME: what about ScrollUp, ScrollDown, Menu*, Option, LogOff, Save,.. any others? */
342#endif /* HAVE_X11_XF86KEYSYM_H */
343};
344
345#define SETTINGS_CONNECTION_DATA_KEY "EphyWindowSettings"
346
347#define EPHY_WINDOW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_WINDOW, EphyWindowPrivate))
348
349struct _EphyWindowPrivate
350{
351 GtkWidget *main_vbox;
352 GtkWidget *toolbar;
353 GtkUIManager *manager;
354 GtkActionGroup *action_group;
355 GtkActionGroup *popups_action_group;
356 GtkActionGroup *toolbar_action_group;
357 GtkActionGroup *tab_accels_action_group;
358 EphyEncodingMenu *enc_menu;
359 GtkNotebook *notebook;
360 EphyEmbed *active_embed;
361 EphyWindowChrome chrome;
362 EphyEmbedEvent *context_event;
363 WebKitHitTestResult *hit_test_result;
364 guint idle_worker;
365 GtkWidget *downloads_box;
366
367 EphyLocationController *location_controller;
368
369 gulong app_menu_visibility_handler;
370
371 guint closing : 1;
372 guint has_size : 1;
373 guint fullscreen_mode : 1;
374 guint is_popup : 1;
375 guint present_on_insert : 1;
376 guint key_theme_is_emacs : 1;
377 guint updating_address : 1;
378 guint force_close : 1;
379 guint checking_modified_forms : 1;
380};
381
382enum
383{
384 PROP_0,
385 PROP_ACTIVE_CHILD,
386 PROP_CHROME,
387 PROP_SINGLE_TAB_MODE
388};
389
390/* Make sure not to overlap with those in ephy-lockdown.c */
391enum
392{
393 SENS_FLAG_CHROME = 1 << 0,
394 SENS_FLAG_CONTEXT = 1 << 1,
395 SENS_FLAG_DOCUMENT = 1 << 2,
396 SENS_FLAG_LOADING = 1 << 3,
397 SENS_FLAG_NAVIGATION = 1 << 4,
398 SENS_FLAG_IS_BLANK = 1 << 5
399};
400
401static gint
402impl_add_child (EphyEmbedContainer *container,
403 EphyEmbed *child,
404 gint position,
405 gboolean jump_to)
406{
407 EphyWindow *window = EPHY_WINDOW (container);
408
409 g_return_val_if_fail (!window->priv->is_popup ||
410 gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->priv->notebook)) < 1, -1);
411
412 return ephy_notebook_add_tab (EPHY_NOTEBOOK (window->priv->notebook),
413 child, position, jump_to);
414}
415
416static void
417impl_set_active_child (EphyEmbedContainer *container,
418 EphyEmbed *child)
419{
420 int page;
421 EphyWindow *window;
422
423 window = EPHY_WINDOW (container);
424
425 page = gtk_notebook_page_num
426 (window->priv->notebook, GTK_WIDGET (child));
427 gtk_notebook_set_current_page
428 (window->priv->notebook, page);
429}
430
431static GtkWidget *
432construct_confirm_close_dialog (EphyWindow *window,
433 const char *title,
434 const char *info,
435 const char *action)
436{
437 GtkWidget *dialog;
438
439 dialog = gtk_message_dialog_new (GTK_WINDOW (window),
440 GTK_DIALOG_MODAL,
441 GTK_MESSAGE_WARNING,
442 GTK_BUTTONS_CANCEL,
443 "%s", title);
444
445 gtk_message_dialog_format_secondary_text
446 (GTK_MESSAGE_DIALOG (dialog), "%s", info);
447
448 gtk_dialog_add_button (GTK_DIALOG (dialog),
449 action, GTK_RESPONSE_ACCEPT);
450
451 gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
452
453 /* FIXME gtk_window_set_title (GTK_WINDOW (dialog), _("Close Document?")); */
454 gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (window)),
455 GTK_WINDOW (dialog));
456
457 return dialog;
458}
459
460static gboolean
461confirm_close_with_modified_forms (EphyWindow *window)
462{
463 GtkWidget *dialog;
464 int response;
465
466 dialog = construct_confirm_close_dialog (window,
467 _("There are unsubmitted changes to form elements"),
468 _("If you close the document anyway, "
469 "you will lose that information."),
470 _("Close _Document"));
471 response = gtk_dialog_run (GTK_DIALOG (dialog));
472
473 gtk_widget_destroy (dialog);
474
475 return response == GTK_RESPONSE_ACCEPT;
476}
477
478static gboolean
479confirm_close_with_downloads (EphyWindow *window)
480{
481 GtkWidget *dialog;
482 int response;
483
484 dialog = construct_confirm_close_dialog (window,
485 _("There are ongoing downloads in this window"),
486 _("If you close this window, the downloads will be cancelled"),
487 _("Close window and cancel downloads"));
488 response = gtk_dialog_run (GTK_DIALOG (dialog));
489
490 gtk_widget_destroy (dialog);
491
492 return response == GTK_RESPONSE_ACCEPT;
493}
494
495static void
496impl_remove_child (EphyEmbedContainer *container,
497 EphyEmbed *child)
498{
499 EphyWindow *window;
500
501 window = EPHY_WINDOW (container);
502 g_signal_emit_by_name (window->priv->notebook,
503 "tab-close-request",
504 child, window);
505}
506
507static EphyEmbed *
508impl_get_active_child (EphyEmbedContainer *container)
509{
510 return EPHY_WINDOW (container)->priv->active_embed;
511}
512
513static GList *
514impl_get_children (EphyEmbedContainer *container)
515{
516 EphyWindow *window = EPHY_WINDOW (container);
517
518 return gtk_container_get_children (GTK_CONTAINER (window->priv->notebook));
519}
520
521static gboolean
522impl_get_is_popup (EphyEmbedContainer *container)
523{
524 return EPHY_WINDOW (container)->priv->is_popup;
525}
526
527static void
528ephy_window_embed_container_iface_init (EphyEmbedContainerIface *iface)
529{
530 iface->add_child = impl_add_child;
531 iface->set_active_child = impl_set_active_child;
532 iface->remove_child = impl_remove_child;
533 iface->get_active_child = impl_get_active_child;
534 iface->get_children = impl_get_children;
535 iface->get_is_popup = impl_get_is_popup;
536}
537
538static EphyEmbed *
539ephy_window_open_link (EphyLink *link,
540 const char *address,
541 EphyEmbed *embed,
542 EphyLinkFlags flags)
543{
544 EphyWindow *window = EPHY_WINDOW (link);
545 EphyWindowPrivate *priv = window->priv;
546 EphyEmbed *new_embed;
547
548 g_return_val_if_fail (address != NULL, NULL);
549
550 if (embed == NULL)
551 {
552 embed = window->priv->active_embed;
553 }
554
555 if (flags & EPHY_LINK_BOOKMARK)
556 ephy_web_view_set_visit_type (ephy_embed_get_web_view (embed),
557 EPHY_PAGE_VISIT_BOOKMARK);
558 else if (flags & EPHY_LINK_TYPED)
559 ephy_web_view_set_visit_type (ephy_embed_get_web_view (embed),
560 EPHY_PAGE_VISIT_TYPED);
561
562 if (flags & (EPHY_LINK_JUMP_TO |
563 EPHY_LINK_NEW_TAB |
564 EPHY_LINK_NEW_WINDOW))
565 {
566 EphyNewTabFlags ntflags = 0;
567 EphyWindow *target_window = EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (embed)));
568
569 if (flags & EPHY_LINK_JUMP_TO)
570 {
571 ntflags |= EPHY_NEW_TAB_JUMP;
572 }
573
574 if (flags & EPHY_LINK_NEW_WINDOW ||
575 (flags & EPHY_LINK_NEW_TAB && priv->is_popup))
576 {
577 target_window = ephy_window_new ();
578 }
579
580 if (flags & EPHY_LINK_NEW_TAB_APPEND_AFTER)
581 ntflags |= EPHY_NEW_TAB_APPEND_AFTER;
582
583 new_embed = ephy_shell_new_tab
584 (ephy_shell_get_default (),
585 target_window,
586 embed, ntflags);
587 if (flags & EPHY_LINK_HOME_PAGE)
588 {
589 ephy_web_view_load_homepage (ephy_embed_get_web_view (new_embed));
590 ephy_window_activate_location (window);
591 }
592 else
593 {
594 ephy_web_view_load_url (ephy_embed_get_web_view (new_embed), address);
595 if (flags & EPHY_LINK_JUMP_TO)
596 {
597 gtk_widget_grab_focus (GTK_WIDGET (new_embed));
598 }
599 }
600 }
601 else
602 {
603 ephy_web_view_load_url (ephy_embed_get_web_view (embed), address);
604
605 if (address == NULL || address[0] == '\0' || g_str_equal (address, "about:blank"))
606 {
607 ephy_window_activate_location (window);
608 }
609 else
610 {
611 gtk_widget_grab_focus (GTK_WIDGET (embed));
612 }
613
614 new_embed = embed;
615 }
616
617 return new_embed;
618}
619
620static void
621ephy_window_link_iface_init (EphyLinkIface *iface)
622{
623 iface->open_link = ephy_window_open_link;
624}
625
626G_DEFINE_TYPE_WITH_CODE (EphyWindow, ephy_window, GTK_TYPE_APPLICATION_WINDOW,
627 G_IMPLEMENT_INTERFACE (EPHY_TYPE_LINK,
628 ephy_window_link_iface_init)
629 G_IMPLEMENT_INTERFACE (EPHY_TYPE_EMBED_CONTAINER,
630 ephy_window_embed_container_iface_init))
631
632static void
633settings_change_notify (GtkSettings *settings,
634 EphyWindow *window)
635{
636 EphyWindowPrivate *priv = window->priv;
637 char *key_theme_name;
638
639 g_object_get (settings,
640 "gtk-key-theme-name", &key_theme_name,
641 NULL);
642
643 priv->key_theme_is_emacs =
644 key_theme_name &&
645 g_ascii_strcasecmp (key_theme_name, "Emacs") == 0;
646
647 g_free (key_theme_name);
648}
649
650static void
651settings_changed_cb (GtkSettings *settings)
652{
653 GList *list, *l;
654
655 /* FIXME: multi-head */
656 list = gtk_window_list_toplevels ();
657
658 for (l = list; l != NULL; l = l->next)
659 {
660 if (EPHY_IS_WINDOW (l->data))
661 {
662 settings_change_notify (settings, l->data);
663 }
664 }
665
666 g_list_free (list);
667}
668
669static void
670sync_chromes_visibility (EphyWindow *window)
671{
672 EphyWindowPrivate *priv = window->priv;
673 gboolean show_tabsbar, show_downloads_box;
674
675 if (priv->closing)
676 return;
677
678 show_tabsbar = (priv->chrome & EPHY_WINDOW_CHROME_TABSBAR);
679 show_downloads_box = (priv->chrome & EPHY_WINDOW_CHROME_DOWNLOADS_BOX);
680
681 ephy_notebook_set_tabs_allowed (EPHY_NOTEBOOK (priv->notebook),
682 show_tabsbar && !(priv->is_popup || priv->fullscreen_mode));
683 gtk_widget_set_visible (priv->downloads_box,
684 show_downloads_box && !priv->fullscreen_mode);
685}
686
687static void
688ephy_window_set_chrome (EphyWindow *window,
689 EphyWindowChrome chrome)
690{
691 if (window->priv->chrome == chrome)
692 return;
693
694 window->priv->chrome = chrome;
695 if (window->priv->closing)
696 return;
697
698 g_object_notify (G_OBJECT (window), "chrome");
699 sync_chromes_visibility (window);
700}
701
702static void
703sync_tab_load_status (EphyWebView *view,
704 WebKitLoadEvent load_event,
705 EphyWindow *window)
706{
707 EphyWindowPrivate *priv = window->priv;
708 GtkActionGroup *action_group = priv->action_group;
709 GtkAction *action;
710 gboolean loading;
711
712 if (window->priv->closing) return;
713
714 loading = ephy_web_view_is_loading (view);
715
716 action = gtk_action_group_get_action (action_group, "ViewStop");
717 gtk_action_set_sensitive (action, loading);
718
719 /* disable print while loading, see bug #116344 */
720 action = gtk_action_group_get_action (action_group, "FilePrint");
721 ephy_action_change_sensitivity_flags (action, SENS_FLAG_LOADING, loading);
722
723 action = gtk_action_group_get_action (priv->toolbar_action_group,
724 "ViewCombinedStopReload");
725 ephy_combined_stop_reload_action_set_loading (EPHY_COMBINED_STOP_RELOAD_ACTION (action),
726 loading);
727}
728
729static void
730sync_tab_security (EphyWebView *view,
731 GParamSpec *pspec,
732 EphyWindow *window)
733{
734 EphyWindowPrivate *priv = window->priv;
735 EphyTitleBox *title_box;
736 EphySecurityLevel security_level;
737
738 if (priv->closing) return;
739
740 ephy_web_view_get_security_level (view, &security_level, NULL, NULL);
741 title_box = ephy_toolbar_get_title_box (EPHY_TOOLBAR (priv->toolbar));
742 ephy_title_box_set_security_level (title_box, security_level);
743}
744
745static void
746ephy_window_fullscreen (EphyWindow *window)
747{
748 EphyWindowPrivate *priv = window->priv;
749 EphyEmbed *embed;
750
751 priv->fullscreen_mode = TRUE;
752
753 /* sync status */
754 embed = window->priv->active_embed;
755 sync_tab_load_status (ephy_embed_get_web_view (embed), WEBKIT_LOAD_STARTED, window);
756 sync_tab_security (ephy_embed_get_web_view (embed), NULL, window);
757
758 sync_chromes_visibility (window);
759 gtk_widget_hide (priv->toolbar);
760 ephy_embed_entering_fullscreen (embed);
761}
762
763static void
764ephy_window_unfullscreen (EphyWindow *window)
765{
766 window->priv->fullscreen_mode = FALSE;
767
768 gtk_widget_show (window->priv->toolbar);
769 sync_chromes_visibility (window);
770 ephy_embed_leaving_fullscreen (window->priv->active_embed);
771}
772
773static gboolean
774ephy_window_key_press_event (GtkWidget *widget,
775 GdkEventKey *event)
776{
777 EphyWindow *window = EPHY_WINDOW (widget);
778 EphyWindowPrivate *priv = window->priv;
779 GtkWidget *focus_widget;
780 gboolean shortcircuit = FALSE, force_chain = FALSE, handled = FALSE;
781 guint modifier = event->state & gtk_accelerator_get_default_mod_mask ();
782 guint i;
783
784 /* In an attempt to get the mozembed playing nice with things like emacs keybindings
785 * we are passing important events to the focused child widget before letting the window's
786 * base handler see them. This is *completely against* stated gtk2 policy but the
787 * 'correct' behaviour is exceptionally useless. We need to keep an eye out for
788 * unexpected consequences of this decision. IME's should be a high concern, but
789 * considering that the IME folks complained about the upside-down event propagation
790 * rules, we might be doing them a favour.
791 *
792 * We achieve this by first evaluating the event to see if it's important, and if
793 * so, we get the focus widget and attempt to get the widget to handle that event.
794 * If the widget does handle it, we're done (unless force_chain is true, in which
795 * case the event is handled as normal in addition to being sent to the focus
796 * widget), otherwise the event follows the normal handling path.
797 */
798
799 if (event->keyval == GDK_KEY_Escape && modifier == 0)
800 {
801 /* Always pass Escape to both the widget, and the parent */
802 shortcircuit = TRUE;
803 force_chain = TRUE;
804 }
805 else if (priv->key_theme_is_emacs &&
806 (modifier == GDK_CONTROL_MASK) &&
807 event->length > 0 &&
808 /* But don't pass Ctrl+Enter twice */
809 event->keyval != GDK_KEY_Return &&
810 event->keyval != GDK_KEY_KP_Enter &&
811 event->keyval != GDK_KEY_ISO_Enter)
812 {
813 /* Pass CTRL+letter characters to the widget */
814 shortcircuit = TRUE;
815 }
816
817 if (shortcircuit)
818 {
819 focus_widget = gtk_window_get_focus (GTK_WINDOW (window));
820
821 if (GTK_IS_WIDGET (focus_widget))
822 {
823 handled = gtk_widget_event (focus_widget,
824 (GdkEvent*) event);
825 }
826
827 if (handled && !force_chain)
828 {
829 return handled;
830 }
831 }
832
833 /* Handle accelerators that we want bound, but aren't associated with
834 * an action */
835 for (i = 0; i < G_N_ELEMENTS (extra_keybindings); i++)
836 {
837 if (event->keyval == extra_keybindings[i].keyval &&
838 modifier == extra_keybindings[i].modifier)
839 {
840 GtkAction * action = gtk_action_group_get_action
841 (extra_keybindings[i].fromToolbar ?
842 priv->toolbar_action_group :
843 priv->action_group,
844 extra_keybindings[i].action);
845 if (gtk_action_is_sensitive (action))
846 {
847 gtk_action_activate (action);
848 return TRUE;
849 }
850 break;
851 }
852 }
853
854 return GTK_WIDGET_CLASS (ephy_window_parent_class)->key_press_event (widget, event);
855}
856
857static gboolean
858window_has_ongoing_downloads (EphyWindow *window)
859{
860 GList *l, *downloads;
861 gboolean downloading = FALSE;
862
863 downloads = gtk_container_get_children (GTK_CONTAINER (window->priv->downloads_box));
864
865 for (l = downloads; l != NULL; l = l->next)
866 {
867 if (EPHY_IS_DOWNLOAD_WIDGET (l->data) != TRUE)
868 continue;
869
870 if (!ephy_download_widget_download_is_finished (EPHY_DOWNLOAD_WIDGET (l->data)))
871 {
872 downloading = TRUE;
873 break;
874 }
875 }
876 g_list_free (downloads);
877
878 return downloading;
879}
880
881static gboolean
882ephy_window_delete_event (GtkWidget *widget,
883 GdkEventAny *event)
884{
885 if (!ephy_window_close (EPHY_WINDOW (widget)))
886 return TRUE;
887
888 /* proceed with window close */
889 if (GTK_WIDGET_CLASS (ephy_window_parent_class)->delete_event)
890 {
891 return GTK_WIDGET_CLASS (ephy_window_parent_class)->delete_event (widget, event);
892 }
893
894 return FALSE;
895}
896
897#define MAX_SPELL_CHECK_GUESSES 4
898
899static void
900update_link_actions_sensitivity (EphyWindow *window,
901 gboolean link_has_web_scheme)
902{
903 GtkAction *action;
904 GtkActionGroup *action_group;
905
906 action_group = window->priv->popups_action_group;
907
908 action = gtk_action_group_get_action (action_group, "OpenLinkInNewWindow");
909 gtk_action_set_sensitive (action, link_has_web_scheme);
910
911 action = gtk_action_group_get_action (action_group, "OpenLinkInNewTab");
912 ephy_action_change_sensitivity_flags (action, SENS_FLAG_CONTEXT, !link_has_web_scheme);
913}
914
915static void
916update_edit_action_sensitivity (EphyWindow *window, const gchar *action_name, gboolean sensitive, gboolean hide)
917{
918 GtkAction *action;
919
920 action = gtk_action_group_get_action (window->priv->action_group, action_name);
921 gtk_action_set_sensitive (action, sensitive);
922 gtk_action_set_visible (action, !hide || sensitive);
923}
924
925typedef struct
926{
927 EphyWindow *window;
928 const gchar *action_name;
929 gboolean hide;
930} CanEditCommandAsyncData;
931
932static CanEditCommandAsyncData *
933can_edit_command_async_data_new (EphyWindow *window, const gchar *action_name, gboolean hide)
934{
935 CanEditCommandAsyncData *data;
936
937 data = g_slice_new (CanEditCommandAsyncData);
938 data->window = g_object_ref (window);
939 data->action_name = action_name;
940 data->hide = hide;
941
942 return data;
943}
944
945static void
946can_edit_command_async_data_free (CanEditCommandAsyncData *data)
947{
948 if (G_UNLIKELY (!data))
949 return;
950
951 g_object_unref (data->window);
952 g_slice_free (CanEditCommandAsyncData, data);
953}
954
955static void
956can_edit_command_callback (GObject *object, GAsyncResult *result, CanEditCommandAsyncData *data)
957{
958 gboolean sensitive;
959 GError *error = NULL;
960
961 sensitive = webkit_web_view_can_execute_editing_command_finish (WEBKIT_WEB_VIEW (object), result, &error);
962 if (!error)
963 {
964 update_edit_action_sensitivity (data->window, data->action_name, sensitive, data->hide);
965
966 }
967 else
968 {
969 g_error_free (error);
970 }
971
972 can_edit_command_async_data_free (data);
973}
974
975static void
976update_edit_actions_sensitivity (EphyWindow *window, gboolean hide)
977{
978 GtkWidget *widget = gtk_window_get_focus (GTK_WINDOW (window));
979 gboolean can_copy, can_cut, can_undo, can_redo, can_paste;
980
981 if (GTK_IS_EDITABLE (widget))
982 {
983 GtkWidget *entry;
984 gboolean has_selection;
985
986 entry = ephy_toolbar_get_location_entry (EPHY_TOOLBAR (window->priv->toolbar));
987
988 has_selection = gtk_editable_get_selection_bounds
989 (GTK_EDITABLE (widget), NULL, NULL);
990
991 can_copy = has_selection;
992 can_cut = has_selection;
993 can_paste = TRUE;
994 can_undo = ephy_location_entry_get_can_undo (EPHY_LOCATION_ENTRY (entry));
995 can_redo = ephy_location_entry_get_can_redo (EPHY_LOCATION_ENTRY (entry));
996 }
997 else
998 {
999 EphyEmbed *embed;
1000 WebKitWebView *view;
1001 CanEditCommandAsyncData *data;
1002
1003 embed = window->priv->active_embed;
1004 g_return_if_fail (embed != NULL);
1005
1006 view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
1007
1008 data = can_edit_command_async_data_new (window, "EditCopy", hide);
1009 webkit_web_view_can_execute_editing_command (view, WEBKIT_EDITING_COMMAND_COPY, NULL,
1010 (GAsyncReadyCallback)can_edit_command_callback,
1011 data);
1012 data = can_edit_command_async_data_new (window, "EditCut", hide);
1013 webkit_web_view_can_execute_editing_command (view, WEBKIT_EDITING_COMMAND_CUT, NULL,
1014 (GAsyncReadyCallback)can_edit_command_callback,
1015 data);
1016 data = can_edit_command_async_data_new (window, "EditPaste", hide);
1017 webkit_web_view_can_execute_editing_command (view, WEBKIT_EDITING_COMMAND_PASTE, NULL,
1018 (GAsyncReadyCallback)can_edit_command_callback,
1019 data);
1020 data = can_edit_command_async_data_new (window, "EditUndo", hide);
1021 webkit_web_view_can_execute_editing_command (view, "Undo", NULL,
1022 (GAsyncReadyCallback)can_edit_command_callback,
1023 data);
1024 data = can_edit_command_async_data_new (window, "EditRedo", hide);
1025 webkit_web_view_can_execute_editing_command (view, "Redo", NULL,
1026 (GAsyncReadyCallback)can_edit_command_callback,
1027 data);
1028 return;
1029 }
1030
1031 update_edit_action_sensitivity (window, "EditCopy", can_copy, hide);
1032 update_edit_action_sensitivity (window, "EditCut", can_cut, hide);
1033 update_edit_action_sensitivity (window, "EditPaste", can_paste, hide);
1034 update_edit_action_sensitivity (window, "EditUndo", can_undo, hide);
1035 update_edit_action_sensitivity (window, "EditRedo", can_redo, hide);
1036}
1037
1038static void
1039enable_edit_actions_sensitivity (EphyWindow *window)
1040{
1041 GtkActionGroup *action_group;
1042 GtkAction *action;
1043
1044 action_group = window->priv->action_group;
1045
1046 action = gtk_action_group_get_action (action_group, "EditCopy");
1047 gtk_action_set_sensitive (action, TRUE);
1048 gtk_action_set_visible (action, TRUE);
1049 action = gtk_action_group_get_action (action_group, "EditCut");
1050 gtk_action_set_sensitive (action, TRUE);
1051 gtk_action_set_visible (action, TRUE);
1052 action = gtk_action_group_get_action (action_group, "EditPaste");
1053 gtk_action_set_sensitive (action, TRUE);
1054 gtk_action_set_visible (action, TRUE);
1055 action = gtk_action_group_get_action (action_group, "EditUndo");
1056 gtk_action_set_sensitive (action, TRUE);
1057 gtk_action_set_visible (action, TRUE);
1058 action = gtk_action_group_get_action (action_group, "EditRedo");
1059 gtk_action_set_sensitive (action, TRUE);
1060 gtk_action_set_visible (action, TRUE);
1061}
1062
1063static void
1064edit_menu_show_cb (GtkWidget *menu,
1065 EphyWindow *window)
1066{
1067 update_edit_actions_sensitivity (window, FALSE);
1068}
1069
1070static void
1071edit_menu_hide_cb (GtkWidget *menu,
1072 EphyWindow *window)
1073{
1074 enable_edit_actions_sensitivity (window);
1075}
1076
1077static void
1078init_menu_updaters (EphyWindow *window)
1079{
1080 GtkWidget *edit_menu;
1081
1082 edit_menu = gtk_ui_manager_get_widget
1083 (window->priv->manager, "/ui/PagePopup");
1084
1085 g_signal_connect (edit_menu, "show",
1086 G_CALLBACK (edit_menu_show_cb), window);
1087 g_signal_connect (edit_menu, "hide",
1088 G_CALLBACK (edit_menu_hide_cb), window);
1089}
1090
1091static void
1092setup_ui_manager (EphyWindow *window)
1093{
1094 GtkActionGroup *action_group;
1095 GtkAccelGroup *accel_group;
1096 GtkAction *action;
1097 GtkUIManager *manager;
1098
1099 window->priv->main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
1100 gtk_widget_show (window->priv->main_vbox);
1101 gtk_container_add (GTK_CONTAINER (window),
1102 window->priv->main_vbox);
1103
1104 manager = gtk_ui_manager_new ();
1105 accel_group = gtk_ui_manager_get_accel_group (manager);
1106
1107 action_group = gtk_action_group_new ("WindowActions");
1108 gtk_action_group_set_translation_domain (action_group, NULL);
1109 gtk_action_group_add_actions (action_group, ephy_menu_entries,
1110 G_N_ELEMENTS (ephy_menu_entries), window);
1111 gtk_action_group_add_toggle_actions (action_group,
1112 ephy_menu_toggle_entries,
1113 G_N_ELEMENTS (ephy_menu_toggle_entries),
1114 window);
1115 gtk_action_group_set_accel_group (action_group, accel_group);
1116 gtk_ui_manager_insert_action_group (manager, action_group, 0);
1117 window->priv->action_group = action_group;
1118 g_object_unref (action_group);
1119
1120 action = gtk_action_group_get_action (action_group, "FileOpen");
1121 g_object_set (action, "short_label", _("Open"), NULL);
1122 action = gtk_action_group_get_action (action_group, "FileSaveAs");
1123 g_object_set (action, "short_label", _("Save As"), NULL);
1124 action = gtk_action_group_get_action (action_group, "FileSaveAsApplication");
1125 g_object_set (action, "short_label", _("Save As Application"), NULL);
1126 action = gtk_action_group_get_action (action_group, "FilePrint");
1127 g_object_set (action, "short_label", _("Print"), NULL);
1128 action = gtk_action_group_get_action (action_group, "FileBookmarkPage");
1129 g_object_set (action, "short_label", _("Bookmark"), NULL);
1130 action = gtk_action_group_get_action (action_group, "EditFind");
1131 g_object_set (action, "short_label", _("Find"), NULL);
1132
1133 action = gtk_action_group_get_action (action_group, "EditFind");
1134 g_object_set (action, "is_important", TRUE, NULL);
1135
1136 action = gtk_action_group_get_action (action_group, "ViewEncoding");
1137 g_object_set (action, "hide_if_empty", FALSE, NULL);
1138 action = gtk_action_group_get_action (action_group, "ViewZoomIn");
1139 /* Translators: This refers to text size */
1140 g_object_set (action, "short-label", _("Larger"), NULL);
1141 action = gtk_action_group_get_action (action_group, "ViewZoomOut");
1142 /* Translators: This refers to text size */
1143 g_object_set (action, "short-label", _("Smaller"), NULL);
1144
1145 action_group = gtk_action_group_new ("PopupsActions");
1146 gtk_action_group_set_translation_domain (action_group, NULL);
1147 gtk_action_group_add_actions (action_group, ephy_popups_entries,
1148 G_N_ELEMENTS (ephy_popups_entries), window);
1149 gtk_action_group_set_accel_group (action_group, accel_group);
1150 gtk_ui_manager_insert_action_group (manager, action_group, 0);
1151 window->priv->popups_action_group = action_group;
1152 g_object_unref (action_group);
1153
1154 /* Tab accels */
1155 action_group = gtk_action_group_new ("TabAccelsActions");
1156 gtk_action_group_set_accel_group (action_group, accel_group);
1157 gtk_ui_manager_insert_action_group (manager, action_group, 0);
1158 window->priv->tab_accels_action_group = action_group;
1159 g_object_unref (action_group);
1160
1161 action_group = gtk_action_group_new ("SpecialToolbarActions");
1162 action =
1163 g_object_new (EPHY_TYPE_NAVIGATION_HISTORY_ACTION,
1164 "name", "NavigationBack",
1165 "label", _("Back"),
1166 "icon-name", "go-previous-symbolic",
1167 "window", window,
1168 "direction", EPHY_NAVIGATION_HISTORY_DIRECTION_BACK,
1169 NULL);
1170 gtk_action_group_add_action_with_accel (action_group, action,
1171 "<alt>Left");
1172 g_object_unref (action);
1173
1174 action =
1175 g_object_new (EPHY_TYPE_NAVIGATION_HISTORY_ACTION,
1176 "name", "NavigationForward",
1177 "label", _("Forward"),
1178 "icon-name", "go-next-symbolic",
1179 "window", window,
1180 "direction", EPHY_NAVIGATION_HISTORY_DIRECTION_FORWARD,
1181 NULL);
1182 gtk_action_group_add_action_with_accel (action_group, action,
1183 "<alt>Right");
1184 g_object_unref (action);
1185
1186 action =
1187 g_object_new (EPHY_TYPE_ZOOM_ACTION,
1188 "name", "Zoom",
1189 "label", _("Zoom"),
1190 "zoom", 1.0,
1191 NULL);
1192 gtk_action_group_add_action (action_group, action);
1193 g_object_unref (action);
1194
1195 action = g_object_new (EPHY_TYPE_HOME_ACTION,
1196 "name", "FileNewTab",
1197 "icon-name", "tab-new-symbolic",
1198 "label", _("New _Tab"),
1199 NULL);
1200 gtk_action_group_add_action_with_accel (action_group, action, "<control>T");
1201 g_object_unref (action);
1202
1203 action =
1204 g_object_new (EPHY_TYPE_HOME_ACTION,
1205 "name", "FileHome",
1206 "label", _("Go to most visited"),
1207 NULL);
1208 gtk_action_group_add_action_with_accel (action_group, action, "<alt>Home");
1209 g_signal_connect_swapped (action, "open-link",
1210 G_CALLBACK (ephy_link_open), window);
1211 g_object_unref (action);
1212
1213 action = g_object_new (EPHY_TYPE_COMBINED_STOP_RELOAD_ACTION,
1214 "name", "ViewCombinedStopReload",
1215 "loading", FALSE,
1216 "window", window,
1217 NULL);
1218 gtk_action_group_add_action (action_group, action);
1219 g_object_unref (action);
1220
1221 gtk_action_group_set_accel_group (action_group, accel_group);
1222 gtk_ui_manager_insert_action_group (manager, action_group, 0);
1223 window->priv->toolbar_action_group = action_group;
1224 g_object_unref (action_group);
1225
1226 window->priv->manager = manager;
1227 gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
1228}
1229
1230static char *
1231calculate_location (const char *typed_address, const char *address)
1232{
1233 const char *location;
1234
1235 /* If there's a typed address, use that over address. Never
1236 * show URIs in the 'do_not_show_address' array. */
1237 location = typed_address ? typed_address : address;
1238 location = ephy_embed_utils_is_no_show_address (location) ? NULL : location;
1239
1240 return g_strdup (location);
1241}
1242
1243static void
1244_ephy_window_set_default_actions_sensitive (EphyWindow *window,
1245 guint flags,
1246 gboolean set)
1247{
1248 EphyWindowPrivate *priv = window->priv;
1249 GtkActionGroup *action_group;
1250 GtkAction *action;
1251 int i;
1252 const char *action_group_actions[] = { "FileSaveAs", "FileSaveAsApplication", "FilePrint",
1253 "FileSendTo", "FileBookmarkPage", "EditFind",
1254 "EditFindPrev", "EditFindNext", "ViewEncoding",
1255 "ViewZoomIn", "ViewZoomOut", "ViewPageSource",
1256 NULL };
1257
1258 action_group = priv->action_group;
1259
1260 /* Page menu */
1261 for (i = 0; action_group_actions[i] != NULL; i++)
1262 {
1263 action = gtk_action_group_get_action (action_group,
1264 action_group_actions[i]);
1265 ephy_action_change_sensitivity_flags (action,
1266 flags, set);
1267 }
1268
1269 /* Page context popup */
1270 action = gtk_action_group_get_action (priv->popups_action_group,
1271 "ContextBookmarkPage");
1272 ephy_action_change_sensitivity_flags (action,
1273 flags, set);
1274
1275 /* Toolbar */
1276 action = gtk_action_group_get_action (priv->toolbar_action_group,
1277 "ViewCombinedStopReload");
1278 ephy_action_change_sensitivity_flags (action,
1279 flags, set);
1280}
1281
1282static void
1283sync_tab_address (EphyWebView *view,
1284 GParamSpec *pspec,
1285 EphyWindow *window)
1286{
1287 EphyWindowPrivate *priv = window->priv;
1288 const char *address;
1289 const char *typed_address;
1290 char *location;
1291
1292 if (priv->closing) return;
1293
1294 address = ephy_web_view_get_address (view);
1295 typed_address = ephy_web_view_get_typed_address (view);
1296
1297 _ephy_window_set_default_actions_sensitive (window,
1298 SENS_FLAG_IS_BLANK,
1299 ephy_web_view_is_overview (view));
1300
1301 location = calculate_location (typed_address, address);
1302 ephy_window_set_location (window, location);
1303 g_free (location);
1304}
1305
1306static void
1307sync_tab_zoom (WebKitWebView *web_view, GParamSpec *pspec, EphyWindow *window)
1308{
1309 GtkActionGroup *action_group;
1310 GtkAction *action;
1311 gboolean can_zoom_in = TRUE, can_zoom_out = TRUE, can_zoom_normal = FALSE;
1312 double zoom;
1313
1314 if (window->priv->closing) return;
1315
1316 zoom = webkit_web_view_get_zoom_level (web_view);
1317
1318 if (zoom >= ZOOM_MAXIMAL)
1319 {
1320 can_zoom_in = FALSE;
1321 }
1322
1323 if (zoom <= ZOOM_MINIMAL)
1324 {
1325 can_zoom_out = FALSE;
1326 }
1327
1328 if (zoom != 1.0)
1329 {
1330 can_zoom_normal = TRUE;
1331 }
1332
1333 action_group = window->priv->action_group;
1334 action = gtk_action_group_get_action (action_group, "ViewZoomIn");
1335 gtk_action_set_sensitive (action, can_zoom_in);
1336 action = gtk_action_group_get_action (action_group, "ViewZoomOut");
1337 gtk_action_set_sensitive (action, can_zoom_out);
1338 action = gtk_action_group_get_action (action_group, "ViewZoomNormal");
1339 gtk_action_set_sensitive (action, can_zoom_normal);
1340}
1341
1342static void
1343sync_tab_document_type (EphyWebView *view,
1344 GParamSpec *pspec,
1345 EphyWindow *window)
1346{
1347 EphyWindowPrivate *priv = window->priv;
1348 GtkActionGroup *action_group = priv->action_group;
1349 GtkAction *action;
1350 EphyWebViewDocumentType type;
1351 gboolean can_find, disable, is_image;
1352
1353 if (priv->closing) return;
1354
1355 /* update zoom actions */
1356 sync_tab_zoom (WEBKIT_WEB_VIEW (view), NULL, window);
1357
1358 type = ephy_web_view_get_document_type (view);
1359 can_find = (type != EPHY_WEB_VIEW_DOCUMENT_IMAGE);
1360 is_image = type == EPHY_WEB_VIEW_DOCUMENT_IMAGE;
1361 disable = (type != EPHY_WEB_VIEW_DOCUMENT_HTML);
1362
1363 action = gtk_action_group_get_action (action_group, "ViewEncoding");
1364 ephy_action_change_sensitivity_flags (action, SENS_FLAG_DOCUMENT, disable);
1365 action = gtk_action_group_get_action (action_group, "ViewPageSource");
1366 ephy_action_change_sensitivity_flags (action, SENS_FLAG_DOCUMENT, is_image);
1367 action = gtk_action_group_get_action (action_group, "EditFind");
1368 ephy_action_change_sensitivity_flags (action, SENS_FLAG_DOCUMENT, !can_find);
1369 action = gtk_action_group_get_action (action_group, "EditFindNext");
1370 ephy_action_change_sensitivity_flags (action, SENS_FLAG_DOCUMENT, !can_find);
1371 action = gtk_action_group_get_action (action_group, "EditFindPrev");
1372 ephy_action_change_sensitivity_flags (action, SENS_FLAG_DOCUMENT, !can_find);
1373
1374 if (!can_find)
1375 {
1376 ephy_find_toolbar_request_close (ephy_embed_get_find_toolbar (priv->active_embed));
1377 }
1378}
1379
1380static void
1381_ephy_window_action_set_favicon (EphyWindow *window,
1382 GdkPixbuf *icon)
1383{
1384 EphyWindowPrivate *priv = window->priv;
1385
1386 g_object_set (priv->location_controller, "icon", icon, NULL);
1387}
1388
1389static void
1390sync_tab_icon (EphyWebView *view,
1391 GParamSpec *pspec,
1392 EphyWindow *window)
1393{
1394 EphyWindowPrivate *priv = window->priv;
1395 GdkPixbuf *icon;
1396
1397 if (priv->closing) return;
1398
1399 icon = ephy_web_view_get_icon (view);
1400
1401 _ephy_window_action_set_favicon (window, icon);
1402}
1403
1404static void
1405_ephy_window_set_navigation_flags (EphyWindow *window,
1406 EphyWebViewNavigationFlags flags)
1407{
1408 GtkAction *action;
1409
1410 action = gtk_action_group_get_action (window->priv->toolbar_action_group, "NavigationBack");
1411 gtk_action_set_sensitive (action, flags & EPHY_WEB_VIEW_NAV_BACK);
1412 action = gtk_action_group_get_action (window->priv->toolbar_action_group, "NavigationForward");
1413 gtk_action_set_sensitive (action, flags & EPHY_WEB_VIEW_NAV_FORWARD);
1414}
1415
1416static void
1417sync_tab_navigation (EphyWebView *view,
1418 GParamSpec *pspec,
1419 EphyWindow *window)
1420{
1421 if (window->priv->closing) return;
1422
1423 _ephy_window_set_navigation_flags (window,
1424 ephy_web_view_get_navigation_flags (view));
1425}
1426
1427static void
1428sync_tab_is_blank (EphyWebView *view,
1429 GParamSpec *pspec,
1430 EphyWindow *window)
1431{
1432 if (window->priv->closing) return;
1433
1434 _ephy_window_set_default_actions_sensitive (window,
1435 SENS_FLAG_IS_BLANK,
1436 ephy_web_view_get_is_blank (view));
1437}
1438
1439static void
1440sync_tab_popup_windows (EphyWebView *view,
1441 GParamSpec *pspec,
1442 EphyWindow *window)
1443{
1444 /* FIXME: show popup count somehow */
1445}
1446
1447static void
1448sync_tab_popups_allowed (EphyWebView *view,
1449 GParamSpec *pspec,
1450 EphyWindow *window)
1451{
1452 GtkAction *action;
1453 gboolean allow;
1454
1455 g_return_if_fail (EPHY_IS_WEB_VIEW (view));
1456 g_return_if_fail (EPHY_IS_WINDOW (window));
1457
1458 action = gtk_action_group_get_action (window->priv->action_group,
1459 "ViewPopupWindows");
1460 g_return_if_fail (GTK_IS_ACTION (action));
1461
1462 g_object_get (view, "popups-allowed", &allow, NULL);
1463
1464 g_signal_handlers_block_by_func
1465 (G_OBJECT (action),
1466 G_CALLBACK (ephy_window_view_popup_windows_cb),
1467 window);
1468
1469 gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), allow);
1470
1471 g_signal_handlers_unblock_by_func
1472 (G_OBJECT (action),
1473 G_CALLBACK (ephy_window_view_popup_windows_cb),
1474 window);
1475}
1476
1477static void
1478sync_tab_title (EphyEmbed *embed,
1479 GParamSpec *pspec,
1480 EphyWindow *window)
1481{
1482 EphyWindowPrivate *priv = window->priv;
1483
1484 if (priv->closing) return;
1485
1486 gtk_window_set_title (GTK_WINDOW(window),
1487 ephy_embed_get_title (embed));
1488}
1489
1490static gboolean
1491idle_unref_context_event (EphyWindow *window)
1492{
1493 EphyWindowPrivate *priv = window->priv;
1494
1495 LOG ("Idle unreffing context event %p", priv->context_event);
1496
1497 if (priv->context_event != NULL)
1498 {
1499 g_object_unref (priv->context_event);
1500 priv->context_event = NULL;
1501 }
1502
1503 priv->idle_worker = 0;
1504 return FALSE;
1505}
1506
1507static void
1508_ephy_window_set_context_event (EphyWindow *window,
1509 EphyEmbedEvent *event)
1510{
1511 EphyWindowPrivate *priv = window->priv;
1512
1513 if (priv->idle_worker != 0)
1514 {
1515 g_source_remove (priv->idle_worker);
1516 priv->idle_worker = 0;
1517 }
1518
1519 if (priv->context_event != NULL)
1520 {
1521 g_object_unref (priv->context_event);
1522 }
1523
1524 priv->context_event = event != NULL ? g_object_ref (event) : NULL;
1525}
1526
1527static void
1528_ephy_window_unset_context_event (EphyWindow *window)
1529{
1530 EphyWindowPrivate *priv = window->priv;
1531
1532 /* Unref the event from idle since we still need it
1533 * from the action callbacks which will run before idle.
1534 */
1535 if (priv->idle_worker == 0 && priv->context_event != NULL)
1536 {
1537 priv->idle_worker =
1538 g_idle_add ((GSourceFunc) idle_unref_context_event, window);
1539 }
1540}
1541
1542static void
1543context_menu_dismissed_cb (WebKitWebView *webView,
1544 EphyWindow *window)
1545{
1546 LOG ("Deactivating popup menu");
1547
1548 enable_edit_actions_sensitivity (window);
1549
1550 g_signal_handlers_disconnect_by_func
1551 (webView, G_CALLBACK (context_menu_dismissed_cb), window);
1552
1553 _ephy_window_unset_context_event (window);
1554}
1555
1556static void
1557add_action_to_context_menu (WebKitContextMenu *context_menu,
1558 GtkActionGroup *action_group,
1559 const char *action_name)
1560{
1561 GtkAction *action;
1562
1563 action = gtk_action_group_get_action (action_group, action_name);
1564 webkit_context_menu_append (context_menu, webkit_context_menu_item_new (action));
1565}
1566
1567static void
1568add_item_to_context_menu (WebKitContextMenu *context_menu,
1569 WebKitContextMenuItem *item)
1570{
1571 if (!item)
1572 return;
1573
1574 webkit_context_menu_append (context_menu, item);
1575 g_object_unref (item);
1576}
1577
1578/* FIXME: Add webkit_context_menu_find() ? */
1579static WebKitContextMenuItem *
1580find_item_in_context_menu (WebKitContextMenu *context_menu,
1581 WebKitContextMenuAction action)
1582{
1583 GList *items, *iter;
1584
1585 items = webkit_context_menu_get_items (context_menu);
1586 for (iter = items; iter; iter = g_list_next (iter))
1587 {
1588 WebKitContextMenuItem *item = (WebKitContextMenuItem *)iter->data;
1589
1590 if (webkit_context_menu_item_get_stock_action (item) == action)
1591 return g_object_ref (item);
1592 }
1593
1594 return NULL;
1595}
1596
1597static GList *
1598find_spelling_guess_context_menu_items (WebKitContextMenu *context_menu)
1599{
1600 GList *items, *iter;
1601 guint i;
1602 GList *retval = NULL;
1603
1604 items = webkit_context_menu_get_items (context_menu);
1605 for (iter = items, i = 0; iter && i < MAX_SPELL_CHECK_GUESSES; iter = g_list_next (iter), i++)
1606 {
1607 WebKitContextMenuItem *item = (WebKitContextMenuItem *)iter->data;
1608
1609 if (webkit_context_menu_item_get_stock_action (item) == WEBKIT_CONTEXT_MENU_ACTION_SPELLING_GUESS)
1610 {
1611 retval = g_list_prepend (retval, g_object_ref (item));
1612 }
1613 else
1614 {
1615 /* Spelling guesses are always at the beginning of the context menu, so
1616 * we can break the loop as soon as we find the first item that is not
1617 * spelling guess.
1618 */
1619 break;
1620 }
1621 }
1622
1623 return g_list_reverse (retval);
1624}
1625
1626static gboolean
1627populate_context_menu (WebKitWebView *web_view,
1628 WebKitContextMenu *context_menu,
1629 GdkEvent *event,
1630 WebKitHitTestResult *hit_test_result,
1631 EphyWindow *window)
1632{
1633 EphyWindowPrivate *priv = window->priv;
1634 WebKitContextMenuItem *input_methods_item = NULL;
1635 WebKitContextMenuItem *unicode_item = NULL;
1636 WebKitContextMenuItem *play_pause_item = NULL;
1637 WebKitContextMenuItem *mute_item = NULL;
1638 WebKitContextMenuItem *toggle_controls_item = NULL;
1639 WebKitContextMenuItem *toggle_loop_item = NULL;
1640 WebKitContextMenuItem *fullscreen_item = NULL;
1641 GList *spelling_guess_items = NULL;
1642 EphyEmbedEvent *embed_event;
1643 gboolean is_document = FALSE;
1644 gboolean app_mode;
1645 gboolean is_image;
1646 gboolean is_media = FALSE;
1647 gboolean is_video = FALSE;
1648 gboolean is_audio = FALSE;
1649
1650 is_image = webkit_hit_test_result_context_is_image (hit_test_result);
1651
1652 if (webkit_hit_test_result_context_is_editable (hit_test_result)) {
1653 input_methods_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_INPUT_METHODS);
1654 unicode_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_UNICODE);
1655 spelling_guess_items = find_spelling_guess_context_menu_items (context_menu);
1656 }
1657
1658 if (webkit_hit_test_result_context_is_media (hit_test_result))
1659 {
1660 WebKitContextMenuItem *item;
1661
1662 is_media = TRUE;
1663 play_pause_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PLAY);
1664 if (!play_pause_item)
1665 play_pause_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PAUSE);
1666 mute_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_MEDIA_MUTE);
1667 toggle_controls_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_TOGGLE_MEDIA_CONTROLS);
1668 toggle_loop_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_TOGGLE_MEDIA_LOOP);
1669 fullscreen_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_ENTER_VIDEO_FULLSCREEN);
1670
1671 item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_COPY_VIDEO_LINK_TO_CLIPBOARD);
1672 if (item)
1673 {
1674 is_video = TRUE;
1675 g_object_unref (item);
1676 }
1677 else
1678 {
1679 item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_COPY_AUDIO_LINK_TO_CLIPBOARD);
1680 if (item)
1681 {
1682 is_audio = TRUE;
1683 g_object_unref (item);
1684 }
1685 }
1686 }
1687
1688 webkit_context_menu_remove_all (context_menu);
1689
1690 embed_event = ephy_embed_event_new ((GdkEventButton *)event, hit_test_result);
1691 _ephy_window_set_context_event (window, embed_event);
1692 g_object_unref (embed_event);
1693
1694 app_mode = ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) == EPHY_EMBED_SHELL_MODE_APPLICATION;
1695
1696 update_edit_actions_sensitivity (window, FALSE);
1697
1698 if (webkit_hit_test_result_context_is_link (hit_test_result))
1699 {
1700 const char *uri;
1701 gboolean link_has_web_scheme;
1702
1703 uri = webkit_hit_test_result_get_link_uri (hit_test_result);
1704 link_has_web_scheme = ephy_embed_utils_address_has_web_scheme (uri);
1705
1706 update_edit_actions_sensitivity (window, TRUE);
1707 update_link_actions_sensitivity (window, link_has_web_scheme);
1708
1709 if (!app_mode)
1710 {
1711 add_action_to_context_menu (context_menu,
1712 priv->popups_action_group, "OpenLinkInNewTab");
1713 add_action_to_context_menu (context_menu,
1714 priv->popups_action_group, "OpenLinkInNewWindow");
1715 webkit_context_menu_append (context_menu,
1716 webkit_context_menu_item_new_separator ());
1717 }
1718 add_action_to_context_menu (context_menu,
1719 priv->action_group, "EditCopy");
1720 webkit_context_menu_append (context_menu,
1721 webkit_context_menu_item_new_separator ());
1722 add_action_to_context_menu (context_menu,
1723 priv->popups_action_group, "DownloadLinkAs");
1724
1725 if (g_str_has_prefix (uri, "mailto:"))
1726 {
1727 add_action_to_context_menu (context_menu,
1728 priv->popups_action_group, "CopyEmailAddress");
1729 }
1730 else
1731 {
1732 add_action_to_context_menu (context_menu,
1733 priv->popups_action_group, "CopyLinkAddress");
1734 }
1735 }
1736 else if (webkit_hit_test_result_context_is_editable (hit_test_result))
1737 {
1738 GList *l;
1739 gboolean has_guesses = FALSE;
1740
1741 for (l = spelling_guess_items; l; l = g_list_next (l))
1742 {
1743 WebKitContextMenuItem *item = WEBKIT_CONTEXT_MENU_ITEM (l->data);
1744
1745 webkit_context_menu_append (context_menu, item);
1746 g_object_unref (item);
1747 has_guesses = TRUE;
1748 }
1749 g_list_free (spelling_guess_items);
1750
1751 if (has_guesses)
1752 {
1753 webkit_context_menu_append (context_menu,
1754 webkit_context_menu_item_new_separator ());
1755 }
1756
1757 update_edit_actions_sensitivity (window, FALSE);
1758
1759 add_action_to_context_menu (context_menu,
1760 priv->action_group, "EditUndo");
1761 add_action_to_context_menu (context_menu,
1762 priv->action_group, "EditRedo");
1763 webkit_context_menu_append (context_menu,
1764 webkit_context_menu_item_new_separator ());
1765 add_action_to_context_menu (context_menu,
1766 priv->action_group, "EditCut");
1767 add_action_to_context_menu (context_menu,
1768 priv->action_group, "EditCopy");
1769 add_action_to_context_menu (context_menu,
1770 priv->action_group, "EditPaste");
1771 webkit_context_menu_append (context_menu,
1772 webkit_context_menu_item_new_separator ());
1773 add_action_to_context_menu (context_menu,
1774 priv->action_group, "EditSelectAll");
1775 if (input_methods_item || unicode_item)
1776 webkit_context_menu_append (context_menu,
1777 webkit_context_menu_item_new_separator ());
1778 add_item_to_context_menu (context_menu, input_methods_item);
1779 add_item_to_context_menu (context_menu, unicode_item);
1780 }
1781 else
1782 {
1783 is_document = TRUE;
1784
1785 update_edit_actions_sensitivity (window, TRUE);
1786
1787 if (!is_image && !is_media)
1788 {
1789 add_action_to_context_menu (context_menu,
1790 priv->toolbar_action_group, "NavigationBack");
1791 add_action_to_context_menu (context_menu,
1792 priv->toolbar_action_group, "NavigationForward");
1793 add_action_to_context_menu (context_menu,
1794 priv->action_group, "ViewReload");
1795 webkit_context_menu_append (context_menu,
1796 webkit_context_menu_item_new_separator ());
1797 }
1798
1799 add_action_to_context_menu (context_menu,
1800 priv->action_group, "EditCopy");
1801
1802 if (!app_mode && !is_image && !is_media)
1803 {
1804 webkit_context_menu_append (context_menu,
1805 webkit_context_menu_item_new_separator ());
1806 add_action_to_context_menu (context_menu,
1807 priv->popups_action_group, "ContextBookmarkPage");
1808 }
1809 }
1810
1811 if (is_image)
1812 {
1813 webkit_context_menu_append (context_menu,
1814 webkit_context_menu_item_new_separator ());
1815 add_action_to_context_menu (context_menu,
1816 priv->popups_action_group, "SaveImageAs");
1817 add_action_to_context_menu (context_menu,
1818 priv->popups_action_group, "CopyImageLocation");
1819 add_action_to_context_menu (context_menu,
1820 priv->popups_action_group, "ViewImage");
1821 add_action_to_context_menu (context_menu,
1822 priv->popups_action_group, "SetImageAsBackground");
1823 }
1824
1825 if (is_media)
1826 {
1827 add_item_to_context_menu (context_menu, play_pause_item);
1828 add_item_to_context_menu (context_menu, mute_item);
1829 add_item_to_context_menu (context_menu, toggle_controls_item);
1830 add_item_to_context_menu (context_menu, toggle_loop_item);
1831 add_item_to_context_menu (context_menu, fullscreen_item);
1832 webkit_context_menu_append (context_menu,
1833 webkit_context_menu_item_new_separator ());
1834 if (is_video)
1835 {
1836 add_action_to_context_menu (context_menu, priv->popups_action_group,
1837 "OpenVideoInNewWindow");
1838 add_action_to_context_menu (context_menu, priv->popups_action_group,
1839 "OpenVideoInNewTab");
1840 add_action_to_context_menu (context_menu, priv->popups_action_group,
1841 "SaveVideoAs");
1842 add_action_to_context_menu (context_menu, priv->popups_action_group,
1843 "CopyVideoLocation");
1844 }
1845 else if (is_audio)
1846 {
1847 add_action_to_context_menu (context_menu, priv->popups_action_group,
1848 "OpenAudioInNewWindow");
1849 add_action_to_context_menu (context_menu, priv->popups_action_group,
1850 "OpenAudioInNewTab");
1851 add_action_to_context_menu (context_menu, priv->popups_action_group,
1852 "SaveAudioAs");
1853 add_action_to_context_menu (context_menu, priv->popups_action_group,
1854 "CopyAudioLocation");
1855 }
1856 }
1857
1858 g_signal_connect (web_view, "context-menu-dismissed",
1859 G_CALLBACK (context_menu_dismissed_cb),
1860 window);
1861
1862 if (app_mode)
1863 return FALSE;
1864
1865 if (is_document && !is_image && !is_media)
1866 {
1867 webkit_context_menu_append (context_menu,
1868 webkit_context_menu_item_new_separator ());
1869 add_action_to_context_menu (context_menu,
1870 priv->action_group, "FileSendTo");
1871 }
1872
1873 webkit_context_menu_append (context_menu,
1874 webkit_context_menu_item_new_separator ());
1875 webkit_context_menu_append (context_menu,
1876 webkit_context_menu_item_new_from_stock_action (WEBKIT_CONTEXT_MENU_ACTION_INSPECT_ELEMENT));
1877
1878 return FALSE;
1879}
1880
1881static gboolean
1882save_target_uri (EphyWindow *window,
1883 WebKitWebView *view,
1884 GdkEventButton *event,
1885 WebKitHitTestResult *hit_test_result)
1886{
1887 guint context;
1888 char *location = NULL;
1889 gboolean retval = FALSE;
1890
1891 g_object_get (hit_test_result, "context", &context, NULL);
1892
1893 LOG ("ephy_window_dom_mouse_click_cb: button %d, context %d, modifier %d (%d:%d)",
1894 event->button, context, event->state, (int)event->x, (int)event->y);
1895
1896 /* shift+click saves the link target */
1897 if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK)
1898 {
1899 g_object_get (G_OBJECT (hit_test_result), "link-uri", &location, NULL);
1900 }
1901 /* Note: pressing enter to submit a form synthesizes a mouse
1902 * click event
1903 */
1904 /* shift+click saves the non-link image */
1905 else if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE &&
1906 !(context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE))
1907 {
1908 g_object_get (G_OBJECT (hit_test_result), "image-uri", &location, NULL);
1909 }
1910
1911 if (location)
1912 {
1913 LOG ("Location: %s", location);
1914
1915 retval = ephy_embed_utils_address_has_web_scheme (location);
1916 if (retval)
1917 {
1918 EphyDownload *download;
1919
1920 download = ephy_download_new_for_uri (location, GTK_WINDOW (window));
1921 ephy_download_set_action (download, EPHY_DOWNLOAD_ACTION_OPEN);
1922 ephy_window_add_download (window, download);
1923 g_object_unref (download);
1924 }
1925
1926 g_free (location);
1927 }
1928
1929 return retval;
1930}
1931
1932static gboolean
1933ephy_window_dom_mouse_click_cb (WebKitWebView *view,
1934 GdkEventButton *event,
1935 EphyWindow *window)
1936{
1937 WebKitHitTestResult *hit_test_result;
1938 gboolean handled = FALSE;
1939
1940 /* Since we're only dealing with shift+click, we can do these
1941 checks early. */
1942 if (!(event->state & GDK_SHIFT_MASK) || event->button != GDK_BUTTON_PRIMARY)
1943 {
1944 return FALSE;
1945 }
1946
1947 hit_test_result = g_object_ref (window->priv->hit_test_result);
1948 handled = save_target_uri (window, view, event, hit_test_result);
1949 g_object_unref (hit_test_result);
1950
1951 return handled;
1952}
1953
1954static void
1955ephy_window_mouse_target_changed_cb (WebKitWebView *web_view,
1956 WebKitHitTestResult *hit_test_result,
1957 guint modifiers,
1958 EphyWindow *window)
1959{
1960 EphyWindowPrivate *priv = window->priv;
1961
1962 if (priv->hit_test_result)
1963 g_object_unref (priv->hit_test_result);
1964 priv->hit_test_result = g_object_ref (hit_test_result);
1965}
1966
1967static void
1968ephy_window_set_is_popup (EphyWindow *window,
1969 gboolean is_popup)
1970{
1971 EphyWindowPrivate *priv = window->priv;
1972
1973 priv->is_popup = is_popup;
1974
1975 g_object_notify (G_OBJECT (window), "is-popup");
1976}
1977
1978static void
1979window_properties_geometry_changed (WebKitWindowProperties *properties,
1980 GParamSpec *pspec,
1981 EphyWindow *window)
1982{
1983 GdkRectangle geometry;
1984
1985 webkit_window_properties_get_geometry (properties, &geometry);
1986 if (geometry.x >= 0 && geometry.y >= 0)
1987 gtk_window_move (GTK_WINDOW (window), geometry.x, geometry.y);
1988 if (geometry.width > 0 && geometry.height > 0)
1989 gtk_window_resize (GTK_WINDOW (window), geometry.width, geometry.height);
1990}
1991
1992static void
1993ephy_window_configure_for_view (EphyWindow *window,
1994 WebKitWebView *web_view)
1995{
1996 WebKitWindowProperties *properties;
1997 GdkRectangle geometry;
1998 EphyWindowChrome chrome = 0;
1999
2000 properties = webkit_web_view_get_window_properties (web_view);
2001
2002 if (webkit_window_properties_get_toolbar_visible (properties))
2003 chrome |= EPHY_WINDOW_CHROME_TOOLBAR;
2004
2005 if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != EPHY_EMBED_SHELL_MODE_APPLICATION)
2006 {
2007 GtkWidget *entry;
2008
2009 entry = ephy_toolbar_get_location_entry (EPHY_TOOLBAR (window->priv->toolbar));
2010 gtk_editable_set_editable (GTK_EDITABLE (entry), FALSE);
2011
2012 if (webkit_window_properties_get_menubar_visible (properties))
2013 chrome |= EPHY_WINDOW_CHROME_MENU;
2014 if (webkit_window_properties_get_locationbar_visible (properties))
2015 chrome |= EPHY_WINDOW_CHROME_LOCATION;
2016 }
2017
2018 webkit_window_properties_get_geometry (properties, &geometry);
2019 if (geometry.width > 0 && geometry.height > 0)
2020 gtk_window_set_default_size (GTK_WINDOW (window), geometry.width, geometry.height);
2021
2022 if (!webkit_window_properties_get_resizable (properties))
2023 gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
2024
2025 window->priv->is_popup = TRUE;
2026 ephy_window_set_chrome (window, chrome);
2027 g_signal_connect (properties, "notify::geometry",
2028 G_CALLBACK (window_properties_geometry_changed),
2029 window);
2030}
2031
2032static gboolean
2033web_view_ready_cb (WebKitWebView *web_view,
2034 WebKitWebView *parent_web_view)
2035{
2036 EphyWindow *window, *parent_view_window;
2037 gboolean using_new_window;
2038
2039 window = EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (web_view)));
2040 parent_view_window = EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (parent_web_view)));
2041
2042 using_new_window = window != parent_view_window;
2043
2044 if (using_new_window)
2045 {
2046 ephy_window_configure_for_view (window, web_view);
2047 g_signal_emit_by_name (parent_web_view, "new-window", web_view);
2048 }
2049
2050 if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) == EPHY_EMBED_SHELL_MODE_APPLICATION &&
2051 !webkit_web_view_get_uri(web_view))
2052 {
2053 /* Wait until we have a valid URL to decide whether to show the window
2054 * or load the URL in the default web browser
2055 */
2056 g_object_set_data_full (G_OBJECT (window), "referrer",
2057 g_strdup (webkit_web_view_get_uri (parent_web_view)),
2058 g_free);
2059 return TRUE;
2060 }
2061
2062 gtk_widget_show (GTK_WIDGET (window));
2063
2064 return TRUE;
2065}
2066
2067static WebKitWebView *
2068create_web_view_cb (WebKitWebView *web_view,
2069 WebKitNavigationAction *navigation_action,
2070 EphyWindow *window)
2071{
2072 EphyEmbed *embed;
2073 WebKitWebView *new_web_view;
2074 EphyNewTabFlags flags;
2075 EphyWindow *target_window;
2076
2077 if ((ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != EPHY_EMBED_SHELL_MODE_APPLICATION) &&
2078 (g_settings_get_boolean (EPHY_SETTINGS_MAIN,
2079 EPHY_PREFS_NEW_WINDOWS_IN_TABS) ||
2080 g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN,
2081 EPHY_PREFS_LOCKDOWN_FULLSCREEN)))
2082 {
2083 target_window = window;
2084 flags = EPHY_NEW_TAB_JUMP |
2085 EPHY_NEW_TAB_APPEND_AFTER;
2086 }
2087 else
2088 {
2089 target_window = ephy_window_new ();
2090 flags = EPHY_NEW_TAB_DONT_SHOW_WINDOW;
2091 }
2092
2093 embed = ephy_shell_new_tab_full (ephy_shell_get_default (),
2094 NULL,
2095 web_view,
2096 target_window,
2097 EPHY_GET_EMBED_FROM_EPHY_WEB_VIEW (web_view),
2098 flags,
2099 0);
2100 if (target_window == window)
2101 gtk_widget_grab_focus (GTK_WIDGET (embed));
2102
2103 new_web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
2104 g_signal_connect (new_web_view, "ready-to-show",
2105 G_CALLBACK (web_view_ready_cb),
2106 web_view);
2107
2108 return new_web_view;
2109}
2110
2111static gboolean
2112decide_policy_cb (WebKitWebView *web_view,
2113 WebKitPolicyDecision *decision,
2114 WebKitPolicyDecisionType decision_type,
2115 EphyWindow *window)
2116{
2117 WebKitNavigationPolicyDecision *navigation_decision;
2118 WebKitNavigationAction *navigation_action;
2119 WebKitNavigationType navigation_type;
2120 WebKitURIRequest *request;
2121 const char *uri;
2122 EphyEmbed *embed;
2123
2124 if (decision_type == WEBKIT_POLICY_DECISION_TYPE_RESPONSE)
2125 return FALSE;
2126
2127 navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision);
2128 navigation_action = webkit_navigation_policy_decision_get_navigation_action (navigation_decision);
2129 request = webkit_navigation_action_get_request (navigation_action);
2130 uri = webkit_uri_request_get_uri (request);
2131
2132 if (!ephy_embed_utils_address_has_web_scheme (uri))
2133 {
2134 GError *error = NULL;
2135 GdkScreen *screen;
2136
2137 screen = gtk_widget_get_screen (GTK_WIDGET (web_view));
2138 gtk_show_uri (screen, uri, GDK_CURRENT_TIME, &error);
2139
2140 if (error)
2141 {
2142 LOG ("failed to handle non web scheme: %s", error->message);
2143 g_error_free (error);
2144
2145 return FALSE;
2146 }
2147
2148 webkit_policy_decision_ignore (decision);
2149
2150 return TRUE;
2151 }
2152
2153 if (decision_type == WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION)
2154 {
2155 const char *frame_name = webkit_navigation_policy_decision_get_frame_name (navigation_decision);
2156
2157 if (g_strcmp0 (frame_name, "_evince_download") == 0)
2158 {
2159 /* The Evince Browser Plugin is requesting us to downlod the document */
2160 webkit_policy_decision_download (decision);
2161 return TRUE;
2162 }
2163
2164 if (!g_settings_get_boolean (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_ENABLE_POPUPS) &&
2165 !webkit_navigation_action_is_user_gesture (navigation_action))
2166 {
2167 webkit_policy_decision_ignore (decision);
2168 return TRUE;
2169 }
2170 }
2171
2172 navigation_type = webkit_navigation_action_get_navigation_type (navigation_action);
2173
2174 if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) == EPHY_EMBED_SHELL_MODE_APPLICATION)
2175 {
2176 if (!gtk_widget_is_visible (GTK_WIDGET (window)))
2177 {
2178 char *referrer;
2179
2180 referrer = (char *)g_object_get_data (G_OBJECT (window), "referrer");
2181
2182 if (ephy_embed_utils_urls_have_same_origin (uri, referrer))
2183 {
2184 gtk_widget_show (GTK_WIDGET (window));
2185 }
2186 else
2187 {
2188 ephy_file_open_uri_in_default_browser (uri, GDK_CURRENT_TIME,
2189 gtk_window_get_screen (GTK_WINDOW (window)));
2190 webkit_policy_decision_ignore (decision);
2191
2192 gtk_widget_destroy (GTK_WIDGET (window));
2193
2194 return TRUE;
2195 }
2196 }
2197
2198 if (navigation_type == WEBKIT_NAVIGATION_TYPE_LINK_CLICKED)
2199 {
2200 if (ephy_embed_utils_urls_have_same_origin (uri, webkit_web_view_get_uri (web_view)))
2201 {
2202 return FALSE;
2203 }
2204
2205 ephy_file_open_uri_in_default_browser (uri, GDK_CURRENT_TIME,
2206 gtk_window_get_screen (GTK_WINDOW (window)));
2207 webkit_policy_decision_ignore (decision);
2208
2209 return TRUE;
2210 }
2211 }
2212
2213 if (navigation_type == WEBKIT_NAVIGATION_TYPE_LINK_CLICKED)
2214 {
2215 gint button;
2216 gint state;
2217 EphyEmbed *new_embed;
2218 EphyNewTabFlags flags = 0;
2219 EphyWindow *target_window = window;
2220
2221 button = webkit_navigation_action_get_mouse_button (navigation_action);
2222 state = webkit_navigation_action_get_modifiers (navigation_action);
2223
2224 ephy_web_view_set_visit_type (EPHY_WEB_VIEW (web_view),
2225 EPHY_PAGE_VISIT_LINK);
2226
2227 /* New tab in new window for control+shift+click */
2228 if (button == 1 && state == (GDK_SHIFT_MASK | GDK_CONTROL_MASK) &&
2229 !g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN,
2230 EPHY_PREFS_LOCKDOWN_FULLSCREEN))
2231 {
2232 target_window = ephy_window_new ();
2233 }
2234 /* New tab in existing window for middle click and
2235 * control+click */
2236 else if (button == 2 || (button == 1 && state == GDK_CONTROL_MASK))
2237 {
2238 flags |= EPHY_NEW_TAB_APPEND_AFTER;
2239 }
2240 /* Because we connect to button-press-event *after*
2241 * (G_CONNECT_AFTER) we need to prevent WebKit from browsing to
2242 * a link when you shift+click it. Otherwise when you
2243 * shift+click a link to download it you would also be taken to
2244 * the link destination. */
2245 else if (button == 1 && state == GDK_SHIFT_MASK)
2246 {
2247 webkit_policy_decision_ignore (decision);
2248
2249 return TRUE;
2250 }
2251 /* Those were our special cases, we won't handle this */
2252 else
2253 {
2254 return FALSE;
2255 }
2256
2257 embed = ephy_embed_container_get_active_child
2258 (EPHY_EMBED_CONTAINER (window));
2259
2260 new_embed = ephy_shell_new_tab_full (ephy_shell_get_default (),
2261 NULL, NULL,
2262 target_window,
2263 embed,
2264 flags,
2265 0);
2266 ephy_web_view_load_request (ephy_embed_get_web_view (new_embed), request);
2267
2268 webkit_policy_decision_ignore (decision);
2269
2270 return TRUE;
2271 }
2272
2273 return FALSE;
2274}
2275
2276static void
2277ephy_window_connect_active_embed (EphyWindow *window)
2278{
2279 EphyEmbed *embed;
2280 WebKitWebView *web_view;
2281 EphyWebView *view;
2282
2283 g_return_if_fail (window->priv->active_embed != NULL);
2284
2285 embed = window->priv->active_embed;
2286 view = ephy_embed_get_web_view (embed);
2287 web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
2288
2289 sync_tab_security (view, NULL, window);
2290 sync_tab_document_type (view, NULL, window);
2291 sync_tab_load_status (view, WEBKIT_LOAD_STARTED, window);
2292 sync_tab_is_blank (view, NULL, window);
2293 sync_tab_navigation (view, NULL, window);
2294 sync_tab_title (embed, NULL, window);
2295 sync_tab_address (view, NULL, window);
2296 sync_tab_icon (view, NULL, window);
2297 sync_tab_popup_windows (view, NULL, window);
2298 sync_tab_popups_allowed (view, NULL, window);
2299
2300 sync_tab_zoom (web_view, NULL, window);
2301
2302 g_signal_connect_object (web_view, "notify::zoom-level",
2303 G_CALLBACK (sync_tab_zoom),
2304 window, 0);
2305
2306 g_signal_connect_object (web_view, "create",
2307 G_CALLBACK (create_web_view_cb),
2308 window, 0);
2309 g_signal_connect_object (web_view, "decide-policy",
2310 G_CALLBACK (decide_policy_cb),
2311 window, 0);
2312 g_signal_connect_object (view, "notify::hidden-popup-count",
2313 G_CALLBACK (sync_tab_popup_windows),
2314 window, 0);
2315 g_signal_connect_object (view, "notify::popups-allowed",
2316 G_CALLBACK (sync_tab_popups_allowed),
2317 window, 0);
2318 g_signal_connect_object (embed, "notify::title",
2319 G_CALLBACK (sync_tab_title),
2320 window, 0);
2321 g_signal_connect_object (view, "notify::address",
2322 G_CALLBACK (sync_tab_address),
2323 window, 0);
2324 g_signal_connect_object (view, "notify::icon",
2325 G_CALLBACK (sync_tab_icon),
2326 window, 0);
2327 g_signal_connect_object (view, "notify::security-level",
2328 G_CALLBACK (sync_tab_security),
2329 window, 0);
2330 g_signal_connect_object (view, "notify::document-type",
2331 G_CALLBACK (sync_tab_document_type),
2332 window, 0);
2333 g_signal_connect_object (view, "load-changed",
2334 G_CALLBACK (sync_tab_load_status),
2335 window, 0);
2336 g_signal_connect_object (view, "notify::navigation",
2337 G_CALLBACK (sync_tab_navigation),
2338 window, 0);
2339 g_signal_connect_object (view, "notify::is-blank",
2340 G_CALLBACK (sync_tab_is_blank),
2341 window, 0);
2342 g_signal_connect_object (view, "button-press-event",
2343 G_CALLBACK (ephy_window_dom_mouse_click_cb),
2344 window, 0);
2345 g_signal_connect_object (view, "context-menu",
2346 G_CALLBACK (populate_context_menu),
2347 window, 0);
2348 g_signal_connect_object (view, "mouse-target-changed",
2349 G_CALLBACK (ephy_window_mouse_target_changed_cb),
2350 window, 0);
2351
2352 g_object_notify (G_OBJECT (window), "active-child");
2353}
2354
2355static void
2356ephy_window_disconnect_active_embed (EphyWindow *window)
2357{
2358 EphyEmbed *embed;
2359 WebKitWebView *web_view;
2360 EphyWebView *view;
2361
2362 g_return_if_fail (window->priv->active_embed != NULL);
2363
2364 embed = window->priv->active_embed;
2365 web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
2366 view = EPHY_WEB_VIEW (web_view);
2367
2368 g_signal_handlers_disconnect_by_func (web_view,
2369 G_CALLBACK (sync_tab_zoom),
2370 window);
2371 g_signal_handlers_disconnect_by_func (web_view,
2372 G_CALLBACK (create_web_view_cb),
2373 window);
2374 g_signal_handlers_disconnect_by_func (view,
2375 G_CALLBACK (decide_policy_cb),
2376 window);
2377 g_signal_handlers_disconnect_by_func (view,
2378 G_CALLBACK (sync_tab_popup_windows),
2379 window);
2380 g_signal_handlers_disconnect_by_func (view,
2381 G_CALLBACK (sync_tab_popups_allowed),
2382 window);
2383 g_signal_handlers_disconnect_by_func (view,
2384 G_CALLBACK (sync_tab_security),
2385 window);
2386 g_signal_handlers_disconnect_by_func (view,
2387 G_CALLBACK (sync_tab_document_type),
2388 window);
2389 g_signal_handlers_disconnect_by_func (view,
2390 G_CALLBACK (sync_tab_load_status),
2391 window);
2392 g_signal_handlers_disconnect_by_func (view,
2393 G_CALLBACK (sync_tab_is_blank),
2394 window);
2395 g_signal_handlers_disconnect_by_func (view,
2396 G_CALLBACK (sync_tab_navigation),
2397 window);
2398 g_signal_handlers_disconnect_by_func (embed,
2399 G_CALLBACK (sync_tab_title),
2400 window);
2401 g_signal_handlers_disconnect_by_func (view,
2402 G_CALLBACK (sync_tab_address),
2403 window);
2404 g_signal_handlers_disconnect_by_func (view,
2405 G_CALLBACK (sync_tab_icon),
2406 window);
2407
2408 g_signal_handlers_disconnect_by_func
2409 (view, G_CALLBACK (ephy_window_dom_mouse_click_cb), window);
2410 g_signal_handlers_disconnect_by_func (view,
2411 G_CALLBACK (populate_context_menu),
2412 window);
2413 g_signal_handlers_disconnect_by_func (view,
2414 G_CALLBACK (ephy_window_mouse_target_changed_cb),
2415 window);
2416}
2417
2418static void
2419ephy_window_set_active_tab (EphyWindow *window, EphyEmbed *new_embed)
2420{
2421 EphyEmbed *old_embed;
2422
2423 g_return_if_fail (EPHY_IS_WINDOW (window));
2424 g_return_if_fail (gtk_widget_get_toplevel (GTK_WIDGET (new_embed)) == GTK_WIDGET (window));
2425
2426 old_embed = window->priv->active_embed;
2427
2428 if (old_embed == new_embed) return;
2429
2430 if (old_embed != NULL)
2431 ephy_window_disconnect_active_embed (window);
2432
2433 window->priv->active_embed = new_embed;
2434
2435 if (new_embed != NULL)
2436 ephy_window_connect_active_embed (window);
2437}
2438
2439static gboolean
2440embed_modal_alert_cb (EphyEmbed *embed,
2441 EphyWindow *window)
2442{
2443 const char *address;
2444
2445 /* switch the window to the tab, and bring the window to the foreground
2446 * (since the alert is modal, the user won't be able to do anything
2447 * with his current window anyway :|)
2448 */
2449 impl_set_active_child (EPHY_EMBED_CONTAINER (window), embed);
2450 gtk_window_present (GTK_WINDOW (window));
2451
2452 /* make sure the location entry shows the real URL of the tab's page */
2453 address = ephy_web_view_get_address (ephy_embed_get_web_view (embed));
2454 ephy_window_set_location (window, address);
2455
2456 /* don't suppress alert */
2457 return FALSE;
2458}
2459
2460static void
2461tab_accels_item_activate (GtkAction *action,
2462 EphyWindow *window)
2463{
2464 EphyWindowPrivate *priv = window->priv;
2465 const char *name;
2466 int tab_number;
2467
2468 name = gtk_action_get_name (action);
2469 tab_number = atoi (name + strlen ("TabAccel"));
2470
2471 gtk_notebook_set_current_page (priv->notebook, tab_number);
2472}
2473
2474static void
2475tab_accels_update (EphyWindow *window)
2476{
2477 EphyWindowPrivate *priv = window->priv;
2478 int pages, i = 0;
2479 GList *actions, *l;
2480
2481 actions = gtk_action_group_list_actions (priv->tab_accels_action_group);
2482 pages = gtk_notebook_get_n_pages (priv->notebook);
2483 for (l = actions; l != NULL; l = l->next)
2484 {
2485 GtkAction *action = GTK_ACTION (l->data);
2486
2487 gtk_action_set_sensitive (action, (i < pages));
2488
2489 i++;
2490 }
2491 g_list_free (actions);
2492}
2493
2494#define TAB_ACCELS_N 10
2495
2496static void
2497setup_tab_accels (EphyWindow *window)
2498{
2499 EphyWindowPrivate *priv = window->priv;
2500 guint id;
2501 int i;
2502
2503 id = gtk_ui_manager_new_merge_id (priv->manager);
2504
2505 for (i = 0; i < TAB_ACCELS_N; i++)
2506 {
2507 GtkAction *action;
2508 char *name;
2509 char *accel;
2510
2511 name = g_strdup_printf ("TabAccel%d", i);
2512 accel = g_strdup_printf ("<alt>%d", (i + 1) % TAB_ACCELS_N);
2513 action = gtk_action_new (name, NULL, NULL, NULL);
2514
2515 gtk_action_group_add_action_with_accel (priv->tab_accels_action_group,
2516 action, accel);
2517
2518 g_signal_connect (action, "activate",
2519 G_CALLBACK (tab_accels_item_activate), window);
2520 gtk_ui_manager_add_ui (priv->manager, id, "/",
2521 name, name,
2522 GTK_UI_MANAGER_ACCELERATOR,
2523 FALSE);
2524
2525 g_object_unref (action);
2526 g_free (accel);
2527 g_free (name);
2528 }
2529}
2530
2531static gboolean
2532show_notebook_popup_menu (GtkNotebook *notebook,
2533 EphyWindow *window,
2534 GdkEventButton *event)
2535{
2536 GtkWidget *menu, *tab, *tab_label;
2537 GtkAction *action;
2538
2539 menu = gtk_ui_manager_get_widget (window->priv->manager, "/EphyNotebookPopup");
2540 g_return_val_if_fail (menu != NULL, FALSE);
2541
2542 /* allow extensions to sync when showing the popup */
2543 action = gtk_action_group_get_action (window->priv->action_group,
2544 "NotebookPopupAction");
2545 g_return_val_if_fail (action != NULL, FALSE);
2546 gtk_action_activate (action);
2547
2548 if (event != NULL)
2549 {
2550 gint n_pages, page_num;
2551
2552 tab = GTK_WIDGET (window->priv->active_embed);
2553 n_pages = gtk_notebook_get_n_pages (notebook);
2554 page_num = gtk_notebook_page_num (notebook, tab);
2555
2556 /* enable/disable move left/right items*/
2557 action = gtk_action_group_get_action (window->priv->action_group,
2558 "TabsMoveLeft");
2559 gtk_action_set_sensitive (action, page_num > 0);
2560
2561 action = gtk_action_group_get_action (window->priv->action_group,
2562 "TabsMoveRight");
2563 gtk_action_set_sensitive (action, page_num < n_pages - 1);
2564
2565 gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
2566 NULL, NULL,
2567 event->button, event->time);
2568 }
2569 else
2570 {
2571 tab = GTK_WIDGET (window->priv->active_embed);
2572 tab_label = gtk_notebook_get_tab_label (notebook, tab);
2573
2574 gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
2575 ephy_gui_menu_position_under_widget, tab_label,
2576 0, gtk_get_current_event_time ());
2577 gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE);
2578 }
2579
2580 return TRUE;
2581}
2582
2583static gboolean
2584notebook_button_press_cb (GtkNotebook *notebook,
2585 GdkEventButton *event,
2586 EphyWindow *window)
2587{
2588 if (GDK_BUTTON_PRESS == event->type && 3 == event->button)
2589 {
2590 return show_notebook_popup_menu (notebook, window, event);
2591 }
2592
2593 return FALSE;
2594}
2595
2596static gboolean
2597notebook_popup_menu_cb (GtkNotebook *notebook,
2598 EphyWindow *window)
2599{
2600 /* Only respond if the notebook is the actual focus */
2601 if (EPHY_IS_NOTEBOOK (gtk_window_get_focus (GTK_WINDOW (window))))
2602 {
2603 return show_notebook_popup_menu (notebook, window, NULL);
2604 }
2605
2606 return FALSE;
2607}
2608
2609static gboolean
2610present_on_idle_cb (GtkWindow *window)
2611{
2612 gtk_window_present (window);
2613 return FALSE;
2614}
2615
2616static gboolean
2617delayed_remove_child (gpointer data)
2618{
2619 GtkWidget *widget = GTK_WIDGET (data);
2620 EphyEmbedContainer *container = EPHY_EMBED_CONTAINER (gtk_widget_get_toplevel (widget));
2621
2622 ephy_embed_container_remove_child (container, EPHY_EMBED (widget));
2623
2624 return FALSE;
2625}
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: