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

Proposed by Jackson Doak
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~noskcaj/ubuntu/wily/epiphany-browser/merge
Merge into: lp:ubuntu/wily/epiphany-browser
Diff against target: 11870 lines (+370/-5393)
24 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 (+86/-0)
NEWS (+8/-0)
configure (+11/-11)
configure.ac (+1/-1)
debian/changelog (+23/-0)
debian/control (+1/-1)
debian/control.in (+1/-1)
debian/patches/00_epiphany-browser.patch (+6/-8)
embed/web-extension/ephy-web-extension.c (+16/-6)
help/de/de.po (+5/-5)
help/de/pref-do-not-track.page (+1/-2)
lib/ephy-web-dom-utils.c (+11/-15)
lib/ephy-web-dom-utils.h (+5/-4)
po/ca.po (+4/-4)
po/eo.po (+1/-1)
po/th.po (+188/-158)
src/ephy-shell-search-provider-generated.c (+1/-1)
src/ephy-shell-search-provider-generated.h (+1/-1)
To merge this branch: bzr merge lp:~noskcaj/ubuntu/wily/epiphany-browser/merge
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Review via email: mp+262919@code.launchpad.net

Description of the change

Merge from debian

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Thanks! Uploaded.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory '.pc/00_epiphany-browser.patch'
2=== removed directory '.pc/00_epiphany-browser.patch'
3=== added file '.pc/00_epiphany-browser.patch/.timestamp'
4=== added file '.pc/00_epiphany-browser.patch/configure.ac'
5--- .pc/00_epiphany-browser.patch/configure.ac 1970-01-01 00:00:00 +0000
6+++ .pc/00_epiphany-browser.patch/configure.ac 2015-06-24 21:42:56 +0000
7@@ -0,0 +1,261 @@
8+# Copyright © 2000-2004 Marco Pesenti Gritti
9+# Copyright © 2003, 2004, 2005, 2006, 2007 Christian Persch
10+#
11+# This program is free software; you can redistribute it and/or modify it
12+# under the terms of the GNU General Public License as published by the
13+# Free Software Foundation; either version 2 of the License, or (at your
14+# option) any later version.
15+#
16+# This program is distributed in the hope that it will be useful, but
17+# WITHOUT ANY WARRANTY; without even the implied warranty of
18+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19+# General Public License for more details.
20+#
21+# You should have received a copy of the GNU General Public License along
22+# with this program; if not, write to the Free Software Foundation, Inc.,
23+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24+
25+m4_define([epiphany_version_major],[3])
26+m4_define([epiphany_version_minor],[16])
27+m4_define([epiphany_version_micro],[2])
28+m4_define([epiphany_version],[epiphany_version_major.epiphany_version_minor.epiphany_version_micro])
29+
30+AC_INIT([GNOME Web Browser],[epiphany_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=epiphany],[epiphany])
31+
32+AC_PREREQ([2.59])
33+
34+AC_CONFIG_MACRO_DIR([m4])
35+AC_CONFIG_HEADERS([config.h])
36+AC_CONFIG_SRCDIR([configure.ac])
37+
38+AC_SUBST([EPIPHANY_MAJOR],[epiphany_version_major.epiphany_version_minor])
39+
40+# for EPHY_CHECK_VERSION
41+AC_SUBST([EPIPHANY_MAJOR_VERSION], [epiphany_version_major])
42+AC_SUBST([EPIPHANY_MINOR_VERSION], [epiphany_version_minor])
43+AC_SUBST([EPIPHANY_MICRO_VERSION], [epiphany_version_micro])
44+
45+AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip tar-ustar])
46+
47+# Use AM_SILENT_RULES if present
48+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
49+
50+AM_MAINTAINER_MODE([enable])
51+
52+# Initialize libtool
53+LT_PREREQ(2.2)
54+LT_INIT([dlopen disable-static])
55+
56+AC_PROG_CC
57+
58+AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
59+AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
60+
61+IT_PROG_INTLTOOL([0.50.0])
62+
63+GLIB_GSETTINGS
64+
65+PKG_PROG_PKG_CONFIG
66+
67+GNOME_DEBUG_CHECK
68+GNOME_COMPILE_WARNINGS([maximum])
69+GNOME_MAINTAINER_MODE_DEFINES
70+
71+GNOME_CODE_COVERAGE
72+
73+WARN_CFLAGS="$WARN_CFLAGS -Wdeclaration-after-statement -Wno-deprecated-declarations -Wno-missing-prototypes"
74+
75+GLIB_REQUIRED=2.38.0
76+GTK_REQUIRED=3.13.0
77+LIBXML_REQUIRED=2.6.12
78+LIBXSLT_REQUIRED=1.1.7
79+WEBKIT_GTK_REQUIRED=2.7.4
80+LIBSOUP_REQUIRED=2.48.0
81+GNOME_DESKTOP_REQUIRED=2.91.2
82+LIBSECRET_REQUIRED=0.14
83+GSETTINGS_DESKTOP_SCHEMAS_REQUIRED=0.0.1
84+LIBNOTIFY_REQUIRED=0.5.1
85+GCR_REQUIRED=3.5.5
86+AVAHI_REQUIRED=0.6.22
87+
88+# Tests
89+
90+AC_MSG_CHECKING([whether to build tests])
91+AC_ARG_ENABLE([tests],
92+ AS_HELP_STRING([--enable-tests],[Whether to build tests (default: yes)]),
93+ [], [enable_tests=yes])
94+AC_MSG_RESULT([$enable_tests])
95+
96+AM_CONDITIONAL([ENABLE_TESTS],[test "$enable_tests" = "yes"])
97+
98+PKG_CHECK_MODULES([DEPENDENCIES], [
99+ glib-2.0 >= $GLIB_REQUIRED
100+ gthread-2.0
101+ gio-unix-2.0 >= $GLIB_REQUIRED
102+ gtk+-3.0 >= $GTK_REQUIRED
103+ gtk+-unix-print-3.0 >= $GTK_REQUIRED
104+ x11
105+ libwnck-3.0
106+ libxml-2.0 >= $LIBXML_REQUIRED
107+ libxslt >= $LIBXSLT_REQUIRED
108+ webkit2gtk-4.0 >= $WEBKIT_GTK_REQUIRED
109+ libsoup-2.4 >= $LIBSOUP_REQUIRED
110+ libsecret-1 >= $LIBSECRET_REQUIRED
111+ gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED
112+ gsettings-desktop-schemas >= $GSETTINGS_DESKTOP_SCHEMAS_REQUIRED
113+ libnotify >= $LIBNOTIFY_REQUIRED
114+ sqlite3
115+ gcr-3 >= $GCR_REQUIRED
116+ avahi-gobject >= $AVAHI_REQUIRED
117+ avahi-client >= $AVAHI_REQUIRED
118+ ])
119+
120+PKG_CHECK_MODULES(WEB_EXTENSION, [
121+ webkit2gtk-web-extension-4.0 >= $WEBKIT_GTK_REQUIRED
122+ libsecret-1 >= $LIBSECRET_REQUIRED
123+ ])
124+AC_SUBST(WEB_EXTENSION_CFLAGS)
125+AC_SUBST(WEB_EXTENSION_LIBS)
126+
127+# ******************
128+# Portability checks
129+# ******************
130+
131+AC_CHECK_FUNCS([localtime_r memchr memmove memset mkdir mkdtemp realpath sqrt strchr strcspn strdup strerror strrchr strtol strtoul strstr])
132+
133+# for backtrace()
134+AC_CHECK_HEADERS([execinfo.h fcntl.h])
135+AC_SEARCH_LIBS([backtrace], [c execinfo])
136+AC_C_INLINE
137+AC_FUNC_MKTIME
138+AC_FUNC_STRTOD
139+AC_TYPE_SIZE_T
140+
141+# ***************
142+# Multimedia keys
143+# ***************
144+
145+AC_CHECK_HEADERS([X11/XF86keysym.h])
146+
147+# ***
148+# NSS
149+# ***
150+
151+AC_MSG_CHECKING([whether NSS support is requested])
152+AC_ARG_ENABLE([nss],
153+ [AS_HELP_STRING([--enable-nss], [Enable NSS support (default: enabled)])],
154+ [], [enable_nss=yes])
155+AC_MSG_RESULT([$enable_nss])
156+
157+if test "$enable_nss" = "yes"; then
158+ PKG_CHECK_MODULES([NSS], [nss])
159+
160+ AC_DEFINE([ENABLE_NSS], [1], [Define to compile with NSS support])
161+fi
162+
163+AM_CONDITIONAL([ENABLE_NSS],[test "$enable_nss" = "yes"])
164+
165+# *******************************
166+# Internationalization
167+# *******************************
168+
169+ISO_CODES_REQUIRED=0.35
170+
171+PKG_CHECK_EXISTS([iso-codes >= $ISO_CODES_REQUIRED],
172+ [have_iso_codes=yes],[have_iso_codes=no])
173+
174+if test "$have_iso_codes" = "yes"; then
175+ AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
176+ if $PKG_CONFIG --variable=domains iso-codes | grep -q 639 && \
177+ $PKG_CONFIG --variable=domains iso-codes | grep -q 3166 ; then
178+ result=yes
179+ else
180+ result=no
181+ have_iso_codes=no
182+ fi
183+ AC_MSG_RESULT([$result])
184+fi
185+
186+if test "$have_iso_codes" = "yes"; then
187+ AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
188+ AC_DEFINE([HAVE_ISO_CODES],[1],[Define if you have the iso-codes package])
189+else
190+ AC_MSG_ERROR([iso-codes is required])
191+fi
192+
193+GETTEXT_PACKAGE=epiphany
194+AC_SUBST([GETTEXT_PACKAGE])
195+AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
196+AM_GLIB_GNU_GETTEXT
197+
198+# *******************************
199+# User help
200+# *******************************
201+
202+YELP_HELP_INIT
203+
204+# ****************
205+# Distributor name
206+# ****************
207+
208+AC_ARG_WITH([distributor-name],
209+ AS_HELP_STRING([--with-distributor-name=name],[Set the distributor name]),
210+ [LSB_DISTRIBUTOR="$withval"])
211+
212+if test -z "$LSB_DISTRIBUTOR"; then
213+ AC_CHECK_PROGS([LSB_RELEASE], [lsb_release],)
214+ if test -n "$LSB_RELEASE"; then
215+ # Fallback on lsb_release if available
216+ LSB_DISTRIBUTOR=$($LSB_RELEASE -i -s)
217+ else
218+ # Fallback on the product name
219+ LSB_DISTRIBUTOR="Epiphany"
220+ fi
221+fi
222+
223+AC_DEFINE_UNQUOTED([LSB_DISTRIBUTOR],["$LSB_DISTRIBUTOR"],[Distributor name])
224+
225+# ************
226+# Output files
227+# ************
228+
229+AC_DEFINE([EPIPHANY_COMPILATION],[1],[Compiling epiphany])
230+
231+AC_CONFIG_FILES([
232+Makefile
233+data/Makefile
234+data/epiphany.desktop.in
235+data/pages/Makefile
236+doc/Makefile
237+help/Makefile
238+lib/Makefile
239+lib/egg/Makefile
240+lib/history/Makefile
241+lib/widgets/Makefile
242+embed/Makefile
243+embed/web-extension/Makefile
244+src/Makefile
245+src/bookmarks/Makefile
246+po/Makefile.in
247+tests/Makefile
248+tests/data/Makefile
249+],
250+[])
251+
252+AC_OUTPUT
253+
254+# *************************************
255+# *************************************
256+
257+echo "
258+Epiphany was configured with the following options:
259+
260+ Source code location : $srcdir
261+ Compiler : $CC
262+ Prefix : $prefix
263+ Extra debugging support : $enable_debug
264+ Build tests : $enable_tests
265+ Code coverage : $enable_code_coverage
266+
267+ NSS support : $enable_nss
268+"
269
270=== removed file '.pc/00_epiphany-browser.patch/configure.ac'
271--- .pc/00_epiphany-browser.patch/configure.ac 2015-06-02 10:42:34 +0000
272+++ .pc/00_epiphany-browser.patch/configure.ac 1970-01-01 00:00:00 +0000
273@@ -1,261 +0,0 @@
274-# Copyright © 2000-2004 Marco Pesenti Gritti
275-# Copyright © 2003, 2004, 2005, 2006, 2007 Christian Persch
276-#
277-# This program is free software; you can redistribute it and/or modify it
278-# under the terms of the GNU General Public License as published by the
279-# Free Software Foundation; either version 2 of the License, or (at your
280-# option) any later version.
281-#
282-# This program is distributed in the hope that it will be useful, but
283-# WITHOUT ANY WARRANTY; without even the implied warranty of
284-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
285-# General Public License for more details.
286-#
287-# You should have received a copy of the GNU General Public License along
288-# with this program; if not, write to the Free Software Foundation, Inc.,
289-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
290-
291-m4_define([epiphany_version_major],[3])
292-m4_define([epiphany_version_minor],[16])
293-m4_define([epiphany_version_micro],[1])
294-m4_define([epiphany_version],[epiphany_version_major.epiphany_version_minor.epiphany_version_micro])
295-
296-AC_INIT([GNOME Web Browser],[epiphany_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=epiphany],[epiphany])
297-
298-AC_PREREQ([2.59])
299-
300-AC_CONFIG_MACRO_DIR([m4])
301-AC_CONFIG_HEADERS([config.h])
302-AC_CONFIG_SRCDIR([configure.ac])
303-
304-AC_SUBST([EPIPHANY_MAJOR],[epiphany_version_major.epiphany_version_minor])
305-
306-# for EPHY_CHECK_VERSION
307-AC_SUBST([EPIPHANY_MAJOR_VERSION], [epiphany_version_major])
308-AC_SUBST([EPIPHANY_MINOR_VERSION], [epiphany_version_minor])
309-AC_SUBST([EPIPHANY_MICRO_VERSION], [epiphany_version_micro])
310-
311-AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip tar-ustar])
312-
313-# Use AM_SILENT_RULES if present
314-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
315-
316-AM_MAINTAINER_MODE([enable])
317-
318-# Initialize libtool
319-LT_PREREQ(2.2)
320-LT_INIT([dlopen disable-static])
321-
322-AC_PROG_CC
323-
324-AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
325-AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
326-
327-IT_PROG_INTLTOOL([0.50.0])
328-
329-GLIB_GSETTINGS
330-
331-PKG_PROG_PKG_CONFIG
332-
333-GNOME_DEBUG_CHECK
334-GNOME_COMPILE_WARNINGS([maximum])
335-GNOME_MAINTAINER_MODE_DEFINES
336-
337-GNOME_CODE_COVERAGE
338-
339-WARN_CFLAGS="$WARN_CFLAGS -Wdeclaration-after-statement -Wno-deprecated-declarations -Wno-missing-prototypes"
340-
341-GLIB_REQUIRED=2.38.0
342-GTK_REQUIRED=3.13.0
343-LIBXML_REQUIRED=2.6.12
344-LIBXSLT_REQUIRED=1.1.7
345-WEBKIT_GTK_REQUIRED=2.7.4
346-LIBSOUP_REQUIRED=2.48.0
347-GNOME_DESKTOP_REQUIRED=2.91.2
348-LIBSECRET_REQUIRED=0.14
349-GSETTINGS_DESKTOP_SCHEMAS_REQUIRED=0.0.1
350-LIBNOTIFY_REQUIRED=0.5.1
351-GCR_REQUIRED=3.5.5
352-AVAHI_REQUIRED=0.6.22
353-
354-# Tests
355-
356-AC_MSG_CHECKING([whether to build tests])
357-AC_ARG_ENABLE([tests],
358- AS_HELP_STRING([--enable-tests],[Whether to build tests (default: yes)]),
359- [], [enable_tests=yes])
360-AC_MSG_RESULT([$enable_tests])
361-
362-AM_CONDITIONAL([ENABLE_TESTS],[test "$enable_tests" = "yes"])
363-
364-PKG_CHECK_MODULES([DEPENDENCIES], [
365- glib-2.0 >= $GLIB_REQUIRED
366- gthread-2.0
367- gio-unix-2.0 >= $GLIB_REQUIRED
368- gtk+-3.0 >= $GTK_REQUIRED
369- gtk+-unix-print-3.0 >= $GTK_REQUIRED
370- x11
371- libwnck-3.0
372- libxml-2.0 >= $LIBXML_REQUIRED
373- libxslt >= $LIBXSLT_REQUIRED
374- webkit2gtk-4.0 >= $WEBKIT_GTK_REQUIRED
375- libsoup-2.4 >= $LIBSOUP_REQUIRED
376- libsecret-1 >= $LIBSECRET_REQUIRED
377- gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED
378- gsettings-desktop-schemas >= $GSETTINGS_DESKTOP_SCHEMAS_REQUIRED
379- libnotify >= $LIBNOTIFY_REQUIRED
380- sqlite3
381- gcr-3 >= $GCR_REQUIRED
382- avahi-gobject >= $AVAHI_REQUIRED
383- avahi-client >= $AVAHI_REQUIRED
384- ])
385-
386-PKG_CHECK_MODULES(WEB_EXTENSION, [
387- webkit2gtk-web-extension-4.0 >= $WEBKIT_GTK_REQUIRED
388- libsecret-1 >= $LIBSECRET_REQUIRED
389- ])
390-AC_SUBST(WEB_EXTENSION_CFLAGS)
391-AC_SUBST(WEB_EXTENSION_LIBS)
392-
393-# ******************
394-# Portability checks
395-# ******************
396-
397-AC_CHECK_FUNCS([localtime_r memchr memmove memset mkdir mkdtemp realpath sqrt strchr strcspn strdup strerror strrchr strtol strtoul strstr])
398-
399-# for backtrace()
400-AC_CHECK_HEADERS([execinfo.h fcntl.h])
401-AC_SEARCH_LIBS([backtrace], [c execinfo])
402-AC_C_INLINE
403-AC_FUNC_MKTIME
404-AC_FUNC_STRTOD
405-AC_TYPE_SIZE_T
406-
407-# ***************
408-# Multimedia keys
409-# ***************
410-
411-AC_CHECK_HEADERS([X11/XF86keysym.h])
412-
413-# ***
414-# NSS
415-# ***
416-
417-AC_MSG_CHECKING([whether NSS support is requested])
418-AC_ARG_ENABLE([nss],
419- [AS_HELP_STRING([--enable-nss], [Enable NSS support (default: enabled)])],
420- [], [enable_nss=yes])
421-AC_MSG_RESULT([$enable_nss])
422-
423-if test "$enable_nss" = "yes"; then
424- PKG_CHECK_MODULES([NSS], [nss])
425-
426- AC_DEFINE([ENABLE_NSS], [1], [Define to compile with NSS support])
427-fi
428-
429-AM_CONDITIONAL([ENABLE_NSS],[test "$enable_nss" = "yes"])
430-
431-# *******************************
432-# Internationalization
433-# *******************************
434-
435-ISO_CODES_REQUIRED=0.35
436-
437-PKG_CHECK_EXISTS([iso-codes >= $ISO_CODES_REQUIRED],
438- [have_iso_codes=yes],[have_iso_codes=no])
439-
440-if test "$have_iso_codes" = "yes"; then
441- AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
442- if $PKG_CONFIG --variable=domains iso-codes | grep -q 639 && \
443- $PKG_CONFIG --variable=domains iso-codes | grep -q 3166 ; then
444- result=yes
445- else
446- result=no
447- have_iso_codes=no
448- fi
449- AC_MSG_RESULT([$result])
450-fi
451-
452-if test "$have_iso_codes" = "yes"; then
453- AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
454- AC_DEFINE([HAVE_ISO_CODES],[1],[Define if you have the iso-codes package])
455-else
456- AC_MSG_ERROR([iso-codes is required])
457-fi
458-
459-GETTEXT_PACKAGE=epiphany
460-AC_SUBST([GETTEXT_PACKAGE])
461-AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
462-AM_GLIB_GNU_GETTEXT
463-
464-# *******************************
465-# User help
466-# *******************************
467-
468-YELP_HELP_INIT
469-
470-# ****************
471-# Distributor name
472-# ****************
473-
474-AC_ARG_WITH([distributor-name],
475- AS_HELP_STRING([--with-distributor-name=name],[Set the distributor name]),
476- [LSB_DISTRIBUTOR="$withval"])
477-
478-if test -z "$LSB_DISTRIBUTOR"; then
479- AC_CHECK_PROGS([LSB_RELEASE], [lsb_release],)
480- if test -n "$LSB_RELEASE"; then
481- # Fallback on lsb_release if available
482- LSB_DISTRIBUTOR=$($LSB_RELEASE -i -s)
483- else
484- # Fallback on the product name
485- LSB_DISTRIBUTOR="Epiphany"
486- fi
487-fi
488-
489-AC_DEFINE_UNQUOTED([LSB_DISTRIBUTOR],["$LSB_DISTRIBUTOR"],[Distributor name])
490-
491-# ************
492-# Output files
493-# ************
494-
495-AC_DEFINE([EPIPHANY_COMPILATION],[1],[Compiling epiphany])
496-
497-AC_CONFIG_FILES([
498-Makefile
499-data/Makefile
500-data/epiphany.desktop.in
501-data/pages/Makefile
502-doc/Makefile
503-help/Makefile
504-lib/Makefile
505-lib/egg/Makefile
506-lib/history/Makefile
507-lib/widgets/Makefile
508-embed/Makefile
509-embed/web-extension/Makefile
510-src/Makefile
511-src/bookmarks/Makefile
512-po/Makefile.in
513-tests/Makefile
514-tests/data/Makefile
515-],
516-[])
517-
518-AC_OUTPUT
519-
520-# *************************************
521-# *************************************
522-
523-echo "
524-Epiphany was configured with the following options:
525-
526- Source code location : $srcdir
527- Compiler : $CC
528- Prefix : $prefix
529- Extra debugging support : $enable_debug
530- Build tests : $enable_tests
531- Code coverage : $enable_code_coverage
532-
533- NSS support : $enable_nss
534-"
535
536=== added directory '.pc/07_bookmarks.patch'
537=== removed directory '.pc/07_bookmarks.patch'
538=== added file '.pc/07_bookmarks.patch/.timestamp'
539=== added directory '.pc/07_bookmarks.patch/data'
540=== removed directory '.pc/07_bookmarks.patch/data'
541=== added file '.pc/07_bookmarks.patch/data/default-bookmarks.rdf.in'
542--- .pc/07_bookmarks.patch/data/default-bookmarks.rdf.in 1970-01-01 00:00:00 +0000
543+++ .pc/07_bookmarks.patch/data/default-bookmarks.rdf.in 2015-06-24 21:42:56 +0000
544@@ -0,0 +1,37 @@
545+<?xml version="1.0"?>
546+<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#">
547+ <channel rdf:about="file://@pkgdatadir@/default-bookmarks.rdf">
548+ <title>Web bookmarks</title>
549+ <link>https://wiki.gnome.org/Apps/Web</link>
550+ <items>
551+ <rdf:Seq>
552+ <rdf:li rdf:resource="https://duckduckgo.com"/>
553+ </rdf:Seq>
554+ </items>
555+ </channel>
556+ <item rdf:about="https://duckduckgo.com">
557+ <_title>Search the web</_title>
558+ <!-- Translators: you can use the regions listed in
559+ https://duckduckgo.com/params to boost a particular region
560+ associated with your language. For instance, for translators
561+ to Finnish, it might make sense to add kl=fi-fi to the search
562+ URL in order to boost results from Finland. Additionally, the
563+ 'kad' parameter can be used to specify the locale in which
564+ duckduckgo must be translated. So, for a Finnish localized
565+ version of duckduckgo that will render results tailored for
566+ Finland, the string would be:
567+ https://duckduckgo.com/?t=epiphany&amp;kl=fi-fi&amp;kad=fi_FI
568+ -->
569+ <_link>https://duckduckgo.com/?t=epiphany</_link>
570+ <!-- Translators: you can use the regions listed in
571+ https://duckduckgo.com/params to boost a particular region
572+ associated with your language. For instance, for translators
573+ to Finnish, it might make sense to add kl=fi-fi to the search
574+ URL in order to boost results from Finland. Additionally, the
575+ 'kad' parameter can be used to specify the locale in which
576+ duckduckgo must be translated. For such case, the search url
577+ would be
578+ https://duckduckgo.com/?q=%s&amp;t=epiphany&amp;kl=fi-fi&amp;kad=fi_FI -->
579+ <_ephy:smartlink>https://duckduckgo.com/?q=%s&amp;t=epiphany</_ephy:smartlink>
580+ </item>
581+</rdf:RDF>
582
583=== removed file '.pc/07_bookmarks.patch/data/default-bookmarks.rdf.in'
584--- .pc/07_bookmarks.patch/data/default-bookmarks.rdf.in 2014-04-11 23:16:25 +0000
585+++ .pc/07_bookmarks.patch/data/default-bookmarks.rdf.in 1970-01-01 00:00:00 +0000
586@@ -1,37 +0,0 @@
587-<?xml version="1.0"?>
588-<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#">
589- <channel rdf:about="file://@pkgdatadir@/default-bookmarks.rdf">
590- <title>Web bookmarks</title>
591- <link>https://wiki.gnome.org/Apps/Web</link>
592- <items>
593- <rdf:Seq>
594- <rdf:li rdf:resource="https://duckduckgo.com"/>
595- </rdf:Seq>
596- </items>
597- </channel>
598- <item rdf:about="https://duckduckgo.com">
599- <_title>Search the web</_title>
600- <!-- Translators: you can use the regions listed in
601- https://duckduckgo.com/params to boost a particular region
602- associated with your language. For instance, for translators
603- to Finnish, it might make sense to add kl=fi-fi to the search
604- URL in order to boost results from Finland. Additionally, the
605- 'kad' parameter can be used to specify the locale in which
606- duckduckgo must be translated. So, for a Finnish localized
607- version of duckduckgo that will render results tailored for
608- Finland, the string would be:
609- https://duckduckgo.com/?t=epiphany&amp;kl=fi-fi&amp;kad=fi_FI
610- -->
611- <_link>https://duckduckgo.com/?t=epiphany</_link>
612- <!-- Translators: you can use the regions listed in
613- https://duckduckgo.com/params to boost a particular region
614- associated with your language. For instance, for translators
615- to Finnish, it might make sense to add kl=fi-fi to the search
616- URL in order to boost results from Finland. Additionally, the
617- 'kad' parameter can be used to specify the locale in which
618- duckduckgo must be translated. For such case, the search url
619- would be
620- https://duckduckgo.com/?q=%s&amp;t=epiphany&amp;kl=fi-fi&amp;kad=fi_FI -->
621- <_ephy:smartlink>https://duckduckgo.com/?q=%s&amp;t=epiphany</_ephy:smartlink>
622- </item>
623-</rdf:RDF>
624
625=== added directory '.pc/12_safetypes.patch'
626=== removed directory '.pc/12_safetypes.patch'
627=== added file '.pc/12_safetypes.patch/.timestamp'
628=== added directory '.pc/12_safetypes.patch/data'
629=== removed directory '.pc/12_safetypes.patch/data'
630=== added file '.pc/12_safetypes.patch/data/mime-types-permissions.xml'
631--- .pc/12_safetypes.patch/data/mime-types-permissions.xml 1970-01-01 00:00:00 +0000
632+++ .pc/12_safetypes.patch/data/mime-types-permissions.xml 2015-06-24 21:42:56 +0000
633@@ -0,0 +1,482 @@
634+<mime-types-permissions>
635+<safe>
636+<mime-type type="application/andrew-inset"/>
637+<mime-type type="application/dicom"/>
638+<mime-type type="application/illustrator"/>
639+<mime-type type="application/mathematica"/>
640+<mime-type type="application/msexcel"/>
641+<mime-type type="application/msword"/>
642+<mime-type type="application/octet-stream"/>
643+<mime-type type="application/oda"/>
644+<mime-type type="application/ogg"/>
645+<mime-type type="application/pdf"/>
646+<mime-type type="application/pgp"/>
647+<mime-type type="application/pgp-encrypted"/>
648+<mime-type type="application/pgp-keys"/>
649+<mime-type type="application/pgp-signature"/>
650+<mime-type type="application/pkcs7-mime"/>
651+<mime-type type="application/pkcs7-signature"/>
652+<mime-type type="application/postscript"/>
653+<mime-type type="application/ram"/>
654+<mime-type type="application/rdf+xml"/>
655+<mime-type type="application/rtf"/>
656+<mime-type type="application/sdp"/>
657+<mime-type type="application/smil"/>
658+<mime-type type="application/stuffit"/>
659+<mime-type type="application/vlc"/>
660+<mime-type type="application/vnd.corel-draw"/>
661+<mime-type type="application/vnd.emusic-emusic_package"/>
662+<mime-type type="application/vnd.lotus-1-2-3"/>
663+<mime-type type="application/vnd.ms-excel"/>
664+<mime-type type="application/vnd.ms-powerpoint"/>
665+<mime-type type="application/vnd.ms-word"/>
666+<mime-type type="application/vnd.oasis.opendocument.text"/>
667+<mime-type type="application/vnd.oasis.opendocument.text-template"/>
668+<mime-type type="application/vnd.oasis.opendocument.text-web"/>
669+<mime-type type="application/vnd.oasis.opendocument.text-master"/>
670+<mime-type type="application/vnd.oasis.opendocument.graphics"/>
671+<mime-type type="application/vnd.oasis.opendocument.graphics-template"/>
672+<mime-type type="application/vnd.oasis.opendocument.presentation"/>
673+<mime-type type="application/vnd.oasis.opendocument.presentation-template"/>
674+<mime-type type="application/vnd.oasis.opendocument.spreadsheet"/>
675+<mime-type type="application/vnd.oasis.opendocument.spreadsheet-template"/>
676+<mime-type type="application/vnd.oasis.opendocument.chart"/>
677+<mime-type type="application/vnd.oasis.opendocument.formula"/>
678+<mime-type type="application/vnd.oasis.opendocument.database"/>
679+<mime-type type="application/vnd.oasis.opendocument.image"/>
680+<mime-type type="application/vnd.rn-realmedia"/>
681+<mime-type type="application/vnd.stardivision.calc"/>
682+<mime-type type="application/vnd.stardivision.chart"/>
683+<mime-type type="application/vnd.stardivision.draw"/>
684+<mime-type type="application/vnd.stardivision.impress"/>
685+<mime-type type="application/vnd.stardivision.mail"/>
686+<mime-type type="application/vnd.stardivision.math"/>
687+<mime-type type="application/vnd.stardivision.writer"/>
688+<mime-type type="application/vnd.sun.xml.calc"/>
689+<mime-type type="application/vnd.sun.xml.calc.template"/>
690+<mime-type type="application/vnd.sun.xml.draw"/>
691+<mime-type type="application/vnd.sun.xml.draw.template"/>
692+<mime-type type="application/vnd.sun.xml.impress"/>
693+<mime-type type="application/vnd.sun.xml.impress.template"/>
694+<mime-type type="application/vnd.sun.xml.math"/>
695+<mime-type type="application/vnd.sun.xml.writer"/>
696+<mime-type type="application/vnd.sun.xml.writer.global"/>
697+<mime-type type="application/vnd.sun.xml.writer.template"/>
698+<mime-type type="application/vnd.wordperfect"/>
699+<mime-type type="application/wordperfect"/>
700+<mime-type type="application/x-7z-compressed"/>
701+<mime-type type="application/x-abiword"/>
702+<mime-type type="application/x-amipro"/>
703+<mime-type type="application/x-applix-spreadsheet"/>
704+<mime-type type="application/x-applix-word"/>
705+<mime-type type="application/x-archive"/>
706+<mime-type type="application/x-arj"/>
707+<mime-type type="application/x-asp"/>
708+<mime-type type="application/x-bcpio"/>
709+<mime-type type="application/x-bittorrent"/>
710+<mime-type type="application/x-blender"/>
711+<mime-type type="application/x-bzip"/>
712+<mime-type type="application/x-bzip2"/>
713+<mime-type type="application/x-bzip-compressed-tar"/>
714+<mime-type type="application/x-cd-image"/>
715+<mime-type type="application/x-cgi"/>
716+<mime-type type="application/x-chess-pgn"/>
717+<mime-type type="application/x-chm"/>
718+<mime-type type="application/x-compress"/>
719+<mime-type type="application/x-compressed-tar"/>
720+<mime-type type="application/x-cpio"/>
721+<mime-type type="application/x-cpio-compressed"/>
722+<mime-type type="application/x-dbase"/>
723+<mime-type type="application/x-dbm"/>
724+<mime-type type="application/x-designer"/>
725+<mime-type type="application/x-desktop"/>
726+<mime-type type="application/x-dia-diagram"/>
727+<mime-type type="application/x-dvi"/>
728+<mime-type type="application/x-e-theme"/>
729+<mime-type type="application/x-egon"/>
730+<mime-type type="application/x-excellon"/>
731+<mime-type type="application/x-flash-video"/>
732+<mime-type type="application/x-font"/>
733+<mime-type type="application/x-font-afm"/>
734+<mime-type type="application/x-font-bdf"/>
735+<mime-type type="application/x-font-dos"/>
736+<mime-type type="application/x-font-framemaker"/>
737+<mime-type type="application/x-font-libgrx"/>
738+<mime-type type="application/x-font-linux-psf"/>
739+<mime-type type="application/x-font-otf"/>
740+<mime-type type="application/x-font-pcf"/>
741+<mime-type type="application/x-font-speedo"/>
742+<mime-type type="application/x-font-sunos-news"/>
743+<mime-type type="application/x-font-tex"/>
744+<mime-type type="application/x-font-tex-tfm"/>
745+<mime-type type="application/x-font-ttf"/>
746+<mime-type type="application/x-font-type1"/>
747+<mime-type type="application/x-font-vfont"/>
748+<mime-type type="application/x-frame"/>
749+<mime-type type="application/x-gdbm"/>
750+<mime-type type="application/x-geda-gsch2pcb-project"/>
751+<mime-type type="application/x-geda-schematic"/>
752+<mime-type type="application/x-geda-symbol"/>
753+<mime-type type="application/x-gerber"/>
754+<mime-type type="application/x-gettext-translation"/>
755+<mime-type type="application/x-glade"/>
756+<mime-type type="application/x-gmc-link"/>
757+<mime-type type="application/x-gnome-app-info"/>
758+<mime-type type="application/x-gnucash"/>
759+<mime-type type="application/x-gnumeric"/>
760+<mime-type type="application/x-graphite"/>
761+<mime-type type="application/x-gtar"/>
762+<mime-type type="application/x-gtktalog"/>
763+<mime-type type="application/x-gzip"/>
764+<mime-type type="application/x-gzpostscript"/>
765+<mime-type type="application/x-hdf"/>
766+<mime-type type="application/x-jar"/>
767+<mime-type type="application/x-java"/>
768+<mime-type type="application/x-java-jnlp-file"/>
769+<mime-type type="application/x-jbuilder-project"/>
770+<mime-type type="application/x-karbon"/>
771+<mime-type type="application/x-kchart"/>
772+<mime-type type="application/x-kformula"/>
773+<mime-type type="application/x-killustrator"/>
774+<mime-type type="application/x-kivio"/>
775+<mime-type type="application/x-kontour"/>
776+<mime-type type="application/x-kpovmodeler"/>
777+<mime-type type="application/x-kpresenter"/>
778+<mime-type type="application/x-krita"/>
779+<mime-type type="application/x-kspread"/>
780+<mime-type type="application/x-kspread-crypt"/>
781+<mime-type type="application/x-ksysv-package"/>
782+<mime-type type="application/x-kugar"/>
783+<mime-type type="application/x-kword"/>
784+<mime-type type="application/x-kword-crypt"/>
785+<mime-type type="application/x-lha"/>
786+<mime-type type="application/x-lhz"/>
787+<mime-type type="application/x-linguist"/>
788+<mime-type type="application/x-lyx"/>
789+<mime-type type="application/x-lzop"/>
790+<mime-type type="application/x-magicpoint"/>
791+<mime-type type="application/x-matroska"/>
792+<mime-type type="application/x-mif"/>
793+<mime-type type="application/x-mozilla-bookmarks"/>
794+<mime-type type="application/x-mswinurl"/>
795+<mime-type type="application/x-mswrite"/>
796+<mime-type type="application/x-nautilus-link"/>
797+<mime-type type="application/x-netcdf"/>
798+<mime-type type="application/x-netscape-bookmarks"/>
799+<mime-type type="application/x-netshow-channel"/>
800+<mime-type type="application/x-ogg"/>
801+<mime-type type="application/x-oleo"/>
802+<mime-type type="application/x-palm-database"/>
803+<mime-type type="application/x-pcb-layout"/>
804+<mime-type type="application/x-pcb-footprint"/>
805+<mime-type type="application/x-pcb-netlist"/>
806+<mime-type type="application/x-pdf"/>
807+<mime-type type="application/x-php"/>
808+<mime-type type="application/x-pkcs12"/>
809+<mime-type type="application/x-profile"/>
810+<mime-type type="application/x-pw"/>
811+<mime-type type="application/x-quattropro"/>
812+<mime-type type="application/x-quicktime-media-link"/>
813+<mime-type type="application/x-quicktimeplayer"/>
814+<mime-type type="application/x-qw"/>
815+<mime-type type="application/x-rar"/>
816+<mime-type type="application/x-reject"/>
817+<mime-type type="application/x-rpm"/>
818+<mime-type type="application/x-sc"/>
819+<mime-type type="application/x-shar"/>
820+<mime-type type="application/x-shared-library-la"/>
821+<mime-type type="application/x-shockwave-flash"/>
822+<mime-type type="application/x-siag"/>
823+<mime-type type="application/x-sit"/>
824+<mime-type type="application/x-slp"/>
825+<mime-type type="application/x-smil"/>
826+<mime-type type="application/x-stuffit"/>
827+<mime-type type="application/x-sv4cpio"/>
828+<mime-type type="application/x-sv4crc"/>
829+<mime-type type="application/x-tar"/>
830+<mime-type type="application/x-tarz"/>
831+<mime-type type="application/x-tex-gf"/>
832+<mime-type type="application/x-tex-pk"/>
833+<mime-type type="application/x-tgif"/>
834+<mime-type type="application/x-theme"/>
835+<mime-type type="application/x-toutdoux"/>
836+<mime-type type="application/x-trash"/>
837+<mime-type type="application/x-troff"/>
838+<mime-type type="application/x-troff-man"/>
839+<mime-type type="application/x-troff-man-compressed"/>
840+<mime-type type="application/x-tzo"/>
841+<mime-type type="application/x-ustar"/>
842+<mime-type type="application/x-wais-source"/>
843+<mime-type type="application/x-wordperfect"/>
844+<mime-type type="application/x-wpg"/>
845+<mime-type type="application/x-x509-ca-cert"/>
846+<mime-type type="application/x-xbel"/>
847+<mime-type type="application/x-zerosize"/>
848+<mime-type type="application/x-zip-compressed"/>
849+<mime-type type="application/x-zoo"/>
850+<mime-type type="application/xhtml+xml"/>
851+<mime-type type="application/zip"/>
852+<mime-type type="audio/ac3"/>
853+<mime-type type="audio/AMR"/>
854+<mime-type type="audio/AMR-WB"/>
855+<mime-type type="audio/basic"/>
856+<mime-type type="audio/midi"/>
857+<mime-type type="audio/mpeg"/>
858+<mime-type type="audio/mpegurl"/>
859+<mime-type type="audio/ogg"/>
860+<mime-type type="audio/playlist"/>
861+<mime-type type="audio/prs.sid"/>
862+<mime-type type="audio/vnd.rn-realaudio"/>
863+<mime-type type="audio/vnd.wave"/>
864+<mime-type type="audio/x-vorbis"/>
865+<mime-type type="audio/wav"/>
866+<mime-type type="audio/x-adpcm"/>
867+<mime-type type="audio/x-aifc"/>
868+<mime-type type="audio/x-aiff"/>
869+<mime-type type="audio/x-aiffc"/>
870+<mime-type type="audio/x-ape"/>
871+<mime-type type="audio/x-flac"/>
872+<mime-type type="audio/x-it"/>
873+<mime-type type="audio/x-m4a"/>
874+<mime-type type="audio/x-matroska"/>
875+<mime-type type="audio/x-midi"/>
876+<mime-type type="audio/x-mod"/>
877+<mime-type type="audio/x-mp3"/>
878+<mime-type type="audio/x-mp3-playlist"/>
879+<mime-type type="audio/x-mpeg"/>
880+<mime-type type="audio/x-mpegurl"/>
881+<mime-type type="audio/x-ms-asx"/>
882+<mime-type type="audio/x-ms-wax"/>
883+<mime-type type="audio/x-musepack"/>
884+<mime-type type="audio/x-pn-realaudio"/>
885+<mime-type type="audio/x-pn-realaudio-plugin"/>
886+<mime-type type="audio/x-realaudio"/>
887+<mime-type type="audio/x-real-audio"/>
888+<mime-type type="audio/x-riff"/>
889+<mime-type type="audio/x-s3m"/>
890+<mime-type type="audio/x-sbc"/>
891+<mime-type type="audio/x-scpls"/>
892+<mime-type type="audio/x-stm"/>
893+<mime-type type="audio/x-tta"/>
894+<mime-type type="audio/x-voc"/>
895+<mime-type type="audio/x-wav"/>
896+<mime-type type="audio/x-wavpack"/>
897+<mime-type type="audio/x-xi"/>
898+<mime-type type="audio/x-xm"/>
899+<mime-type type="image/bmp"/>
900+<mime-type type="image/cgm"/>
901+<mime-type type="image/dpx"/>
902+<mime-type type="image/fax-g3"/>
903+<mime-type type="image/g3fax"/>
904+<mime-type type="image/gif"/>
905+<mime-type type="image/ief"/>
906+<mime-type type="image/jpeg"/>
907+<mime-type type="image/jpeg2000"/>
908+<mime-type type="image/png"/>
909+<mime-type type="image/rle"/>
910+<mime-type type="image/svg+xml"/>
911+<mime-type type="image/tiff"/>
912+<mime-type type="image/vnd.djvu"/>
913+<mime-type type="image/vnd.dwg"/>
914+<mime-type type="image/vnd.dxf"/>
915+<mime-type type="image/x-3ds"/>
916+<mime-type type="image/x-applix-graphics"/>
917+<mime-type type="image/x-cmu-raster"/>
918+<mime-type type="image/x-compressed-xcf"/>
919+<mime-type type="image/x-dcm"/>
920+<mime-type type="image/x-dib"/>
921+<mime-type type="image/x-djvu"/>
922+<mime-type type="image/x-eps"/>
923+<mime-type type="image/x-fits"/>
924+<mime-type type="image/x-fpx"/>
925+<mime-type type="image/x-icb"/>
926+<mime-type type="image/x-ico"/>
927+<mime-type type="image/x-iff"/>
928+<mime-type type="image/x-ilbm"/>
929+<mime-type type="image/x-jng"/>
930+<mime-type type="image/x-lwo"/>
931+<mime-type type="image/x-lws"/>
932+<mime-type type="image/x-msod"/>
933+<mime-type type="image/x-niff"/>
934+<mime-type type="image/x-pcx"/>
935+<mime-type type="image/x-photo-cd"/>
936+<mime-type type="image/x-pict"/>
937+<mime-type type="image/x-png"/>
938+<mime-type type="image/x-portable-anymap"/>
939+<mime-type type="image/x-portable-bitmap"/>
940+<mime-type type="image/x-portable-graymap"/>
941+<mime-type type="image/x-portable-pixmap"/>
942+<mime-type type="image/x-psd"/>
943+<mime-type type="image/x-rgb"/>
944+<mime-type type="image/x-sgi"/>
945+<mime-type type="image/x-sun-raster"/>
946+<mime-type type="image/x-tga"/>
947+<mime-type type="image/x-win-bitmap"/>
948+<mime-type type="image/x-wmf"/>
949+<mime-type type="image/x-xbitmap"/>
950+<mime-type type="image/x-xcf"/>
951+<mime-type type="image/x-xfig"/>
952+<mime-type type="image/x-xpixmap"/>
953+<mime-type type="image/x-xwindowdump"/>
954+<mime-type type="message/delivery-status"/>
955+<mime-type type="message/disposition-notification"/>
956+<mime-type type="message/external-body"/>
957+<mime-type type="message/news"/>
958+<mime-type type="message/partial"/>
959+<mime-type type="message/rfc822"/>
960+<mime-type type="message/x-gnu-rmail"/>
961+<mime-type type="model/vrml"/>
962+<mime-type type="multipart/alternative"/>
963+<mime-type type="multipart/appledouble"/>
964+<mime-type type="multipart/digest"/>
965+<mime-type type="multipart/encrypted"/>
966+<mime-type type="multipart/mixed"/>
967+<mime-type type="multipart/related"/>
968+<mime-type type="multipart/report"/>
969+<mime-type type="multipart/signed"/>
970+<mime-type type="multipart/x-mixed-replace"/>
971+<mime-type type="text/calendar"/>
972+<mime-type type="text/css"/>
973+<mime-type type="text/csv"/>
974+<mime-type type="text/directory"/>
975+<mime-type type="text/enriched"/>
976+<mime-type type="text/google-video-pointer"/>
977+<mime-type type="text/html"/>
978+<mime-type type="text/htmlh"/>
979+<mime-type type="text/mathml"/>
980+<mime-type type="text/plain"/>
981+<mime-type type="text/rdf"/>
982+<mime-type type="text/rfc822-headers"/>
983+<mime-type type="text/richtext"/>
984+<mime-type type="text/rss"/>
985+<mime-type type="text/rtf"/>
986+<mime-type type="text/sgml"/>
987+<mime-type type="text/spreadsheet"/>
988+<mime-type type="text/tab-separated-values"/>
989+<mime-type type="text/vnd.wap.wml"/>
990+<mime-type type="text/x-adasrc"/>
991+<mime-type type="text/x-authors"/>
992+<mime-type type="text/x-bibtex"/>
993+<mime-type type="text/x-c++hdr"/>
994+<mime-type type="text/x-c++src"/>
995+<mime-type type="text/x-chdr"/>
996+<mime-type type="text/x-comma-separated-values"/>
997+<mime-type type="text/x-copying"/>
998+<mime-type type="text/x-credits"/>
999+<mime-type type="text/x-csharp"/>
1000+<mime-type type="text/x-csrc"/>
1001+<mime-type type="text/x-dcl"/>
1002+<mime-type type="text/x-diff"/>
1003+<mime-type type="text/x-dsl"/>
1004+<mime-type type="text/x-dsrc"/>
1005+<mime-type type="text/x-dtd"/>
1006+<mime-type type="text/x-emacs-lisp"/>
1007+<mime-type type="text/x-fortran"/>
1008+<mime-type type="text/x-gettext-translation"/>
1009+<mime-type type="text/x-gettext-translation-template"/>
1010+<mime-type type="text/x-google-video-pointer"/>
1011+<mime-type type="text/x-gtkrc"/>
1012+<mime-type type="text/x-haskell"/>
1013+<mime-type type="text/x-idl"/>
1014+<mime-type type="text/x-install"/>
1015+<mime-type type="text/x-java"/>
1016+<mime-type type="text/x-ksysv-log"/>
1017+<mime-type type="text/x-literate-haskell"/>
1018+<mime-type type="text/x-log"/>
1019+<mime-type type="text/x-makefile"/>
1020+<mime-type type="text/x-moc"/>
1021+<mime-type type="text/x-objcsrc"/>
1022+<mime-type type="text/x-pascal"/>
1023+<mime-type type="text/x-patch"/>
1024+<mime-type type="text/x-python"/>
1025+<mime-type type="text/x-readme"/>
1026+<mime-type type="text/x-scheme"/>
1027+<mime-type type="text/x-setext"/>
1028+<mime-type type="text/x-speech"/>
1029+<mime-type type="text/x-sql"/>
1030+<mime-type type="text/x-tcl"/>
1031+<mime-type type="text/x-tex"/>
1032+<mime-type type="text/x-texinfo"/>
1033+<mime-type type="text/x-troff-me"/>
1034+<mime-type type="text/x-troff-mm"/>
1035+<mime-type type="text/x-troff-ms"/>
1036+<mime-type type="text/x-uil"/>
1037+<mime-type type="text/x-uri"/>
1038+<mime-type type="text/x-vcalendar"/>
1039+<mime-type type="text/x-vcard"/>
1040+<mime-type type="text/x-xmi"/>
1041+<mime-type type="text/x-xslfo"/>
1042+<mime-type type="text/x-xslt"/>
1043+<mime-type type="text/xmcd"/>
1044+<mime-type type="text/xml"/>
1045+<mime-type type="video/flv"/>
1046+<mime-type type="video/isivideo"/>
1047+<mime-type type="video/mp4"/>
1048+<mime-type type="video/mpeg"/>
1049+<mime-type type="video/quicktime"/>
1050+<mime-type type="video/vivo"/>
1051+<mime-type type="video/wavelet"/>
1052+<mime-type type="video/x-anim"/>
1053+<mime-type type="video/x-avi"/>
1054+<mime-type type="video/x-flic"/>
1055+<mime-type type="video/x-flv"/>
1056+<mime-type type="video/x-m4v"/>
1057+<mime-type type="video/x-matroska"/>
1058+<mime-type type="video/x-mng"/>
1059+<mime-type type="video/x-ms-asf"/>
1060+<mime-type type="video/x-ms-asf-plugin"/>
1061+<mime-type type="video/x-ms-wmv"/>
1062+<mime-type type="video/x-ms-wvx"/>
1063+<mime-type type="video/x-msvideo"/>
1064+<mime-type type="video/x-nsv"/>
1065+<mime-type type="video/x-ogm+ogg"/>
1066+<mime-type type="video/x-real-video"/>
1067+<mime-type type="video/x-theora+ogg"/>
1068+<mime-type type="video/x-sgi-movie"/>
1069+</safe>
1070+<unsafe>
1071+<mime-type type="application/mac-binhex40"/>
1072+<mime-type type="application/vnd.hp-hpgl"/>
1073+<mime-type type="application/vnd.hp-pcl"/>
1074+<mime-type type="application/vnd.mozilla.xul+xml"/>
1075+<mime-type type="application/vnd.palm"/>
1076+<mime-type type="application/x-arc"/>
1077+<mime-type type="application/x-awk"/>
1078+<mime-type type="application/x-class-file"/>
1079+<mime-type type="application/x-core"/>
1080+<mime-type type="application/x-csh"/>
1081+<mime-type type="application/x-dc-rom"/>
1082+<mime-type type="application/x-deb"/>
1083+<mime-type type="application/x-executable"/>
1084+<mime-type type="application/x-gameboy-rom"/>
1085+<mime-type type="application/x-genesis-rom"/>
1086+<mime-type type="application/x-ipod-firmware"/>
1087+<mime-type type="application/x-javascript"/>
1088+<mime-type type="application/x-macbinary"/>
1089+<mime-type type="application/x-mplayer2"/>
1090+<mime-type type="application/x-ms-dos-executable"/>
1091+<mime-type type="application/x-msx-rom"/>
1092+<mime-type type="application/x-n64-rom"/>
1093+<mime-type type="application/x-nes-rom"/>
1094+<mime-type type="application/x-object"/>
1095+<mime-type type="application/x-ole-storage"/>
1096+<mime-type type="application/x-par2"/>
1097+<mime-type type="application/x-pef-executable"/>
1098+<mime-type type="application/x-perl"/>
1099+<mime-type type="application/x-python"/>
1100+<mime-type type="application/x-python-bytecode"/>
1101+<mime-type type="application/x-ruby"/>
1102+<mime-type type="application/x-sharedlib"/>
1103+<mime-type type="application/x-shellscript"/>
1104+<mime-type type="application/x-sms-rom"/>
1105+<mime-type type="application/x-xpinstall"/>
1106+<mime-type type="inode/blockdevice"/>
1107+<mime-type type="inode/chardevice"/>
1108+<mime-type type="inode/directory"/>
1109+<mime-type type="inode/fifo"/>
1110+<mime-type type="inode/mount-point"/>
1111+<mime-type type="inode/socket"/>
1112+<mime-type type="inode/symlink"/>
1113+<mime-type type="text/x-ksh"/>
1114+</unsafe>
1115+</mime-types-permissions>
1116
1117=== removed file '.pc/12_safetypes.patch/data/mime-types-permissions.xml'
1118--- .pc/12_safetypes.patch/data/mime-types-permissions.xml 2010-07-03 01:38:24 +0000
1119+++ .pc/12_safetypes.patch/data/mime-types-permissions.xml 1970-01-01 00:00:00 +0000
1120@@ -1,482 +0,0 @@
1121-<mime-types-permissions>
1122-<safe>
1123-<mime-type type="application/andrew-inset"/>
1124-<mime-type type="application/dicom"/>
1125-<mime-type type="application/illustrator"/>
1126-<mime-type type="application/mathematica"/>
1127-<mime-type type="application/msexcel"/>
1128-<mime-type type="application/msword"/>
1129-<mime-type type="application/octet-stream"/>
1130-<mime-type type="application/oda"/>
1131-<mime-type type="application/ogg"/>
1132-<mime-type type="application/pdf"/>
1133-<mime-type type="application/pgp"/>
1134-<mime-type type="application/pgp-encrypted"/>
1135-<mime-type type="application/pgp-keys"/>
1136-<mime-type type="application/pgp-signature"/>
1137-<mime-type type="application/pkcs7-mime"/>
1138-<mime-type type="application/pkcs7-signature"/>
1139-<mime-type type="application/postscript"/>
1140-<mime-type type="application/ram"/>
1141-<mime-type type="application/rdf+xml"/>
1142-<mime-type type="application/rtf"/>
1143-<mime-type type="application/sdp"/>
1144-<mime-type type="application/smil"/>
1145-<mime-type type="application/stuffit"/>
1146-<mime-type type="application/vlc"/>
1147-<mime-type type="application/vnd.corel-draw"/>
1148-<mime-type type="application/vnd.emusic-emusic_package"/>
1149-<mime-type type="application/vnd.lotus-1-2-3"/>
1150-<mime-type type="application/vnd.ms-excel"/>
1151-<mime-type type="application/vnd.ms-powerpoint"/>
1152-<mime-type type="application/vnd.ms-word"/>
1153-<mime-type type="application/vnd.oasis.opendocument.text"/>
1154-<mime-type type="application/vnd.oasis.opendocument.text-template"/>
1155-<mime-type type="application/vnd.oasis.opendocument.text-web"/>
1156-<mime-type type="application/vnd.oasis.opendocument.text-master"/>
1157-<mime-type type="application/vnd.oasis.opendocument.graphics"/>
1158-<mime-type type="application/vnd.oasis.opendocument.graphics-template"/>
1159-<mime-type type="application/vnd.oasis.opendocument.presentation"/>
1160-<mime-type type="application/vnd.oasis.opendocument.presentation-template"/>
1161-<mime-type type="application/vnd.oasis.opendocument.spreadsheet"/>
1162-<mime-type type="application/vnd.oasis.opendocument.spreadsheet-template"/>
1163-<mime-type type="application/vnd.oasis.opendocument.chart"/>
1164-<mime-type type="application/vnd.oasis.opendocument.formula"/>
1165-<mime-type type="application/vnd.oasis.opendocument.database"/>
1166-<mime-type type="application/vnd.oasis.opendocument.image"/>
1167-<mime-type type="application/vnd.rn-realmedia"/>
1168-<mime-type type="application/vnd.stardivision.calc"/>
1169-<mime-type type="application/vnd.stardivision.chart"/>
1170-<mime-type type="application/vnd.stardivision.draw"/>
1171-<mime-type type="application/vnd.stardivision.impress"/>
1172-<mime-type type="application/vnd.stardivision.mail"/>
1173-<mime-type type="application/vnd.stardivision.math"/>
1174-<mime-type type="application/vnd.stardivision.writer"/>
1175-<mime-type type="application/vnd.sun.xml.calc"/>
1176-<mime-type type="application/vnd.sun.xml.calc.template"/>
1177-<mime-type type="application/vnd.sun.xml.draw"/>
1178-<mime-type type="application/vnd.sun.xml.draw.template"/>
1179-<mime-type type="application/vnd.sun.xml.impress"/>
1180-<mime-type type="application/vnd.sun.xml.impress.template"/>
1181-<mime-type type="application/vnd.sun.xml.math"/>
1182-<mime-type type="application/vnd.sun.xml.writer"/>
1183-<mime-type type="application/vnd.sun.xml.writer.global"/>
1184-<mime-type type="application/vnd.sun.xml.writer.template"/>
1185-<mime-type type="application/vnd.wordperfect"/>
1186-<mime-type type="application/wordperfect"/>
1187-<mime-type type="application/x-7z-compressed"/>
1188-<mime-type type="application/x-abiword"/>
1189-<mime-type type="application/x-amipro"/>
1190-<mime-type type="application/x-applix-spreadsheet"/>
1191-<mime-type type="application/x-applix-word"/>
1192-<mime-type type="application/x-archive"/>
1193-<mime-type type="application/x-arj"/>
1194-<mime-type type="application/x-asp"/>
1195-<mime-type type="application/x-bcpio"/>
1196-<mime-type type="application/x-bittorrent"/>
1197-<mime-type type="application/x-blender"/>
1198-<mime-type type="application/x-bzip"/>
1199-<mime-type type="application/x-bzip2"/>
1200-<mime-type type="application/x-bzip-compressed-tar"/>
1201-<mime-type type="application/x-cd-image"/>
1202-<mime-type type="application/x-cgi"/>
1203-<mime-type type="application/x-chess-pgn"/>
1204-<mime-type type="application/x-chm"/>
1205-<mime-type type="application/x-compress"/>
1206-<mime-type type="application/x-compressed-tar"/>
1207-<mime-type type="application/x-cpio"/>
1208-<mime-type type="application/x-cpio-compressed"/>
1209-<mime-type type="application/x-dbase"/>
1210-<mime-type type="application/x-dbm"/>
1211-<mime-type type="application/x-designer"/>
1212-<mime-type type="application/x-desktop"/>
1213-<mime-type type="application/x-dia-diagram"/>
1214-<mime-type type="application/x-dvi"/>
1215-<mime-type type="application/x-e-theme"/>
1216-<mime-type type="application/x-egon"/>
1217-<mime-type type="application/x-excellon"/>
1218-<mime-type type="application/x-flash-video"/>
1219-<mime-type type="application/x-font"/>
1220-<mime-type type="application/x-font-afm"/>
1221-<mime-type type="application/x-font-bdf"/>
1222-<mime-type type="application/x-font-dos"/>
1223-<mime-type type="application/x-font-framemaker"/>
1224-<mime-type type="application/x-font-libgrx"/>
1225-<mime-type type="application/x-font-linux-psf"/>
1226-<mime-type type="application/x-font-otf"/>
1227-<mime-type type="application/x-font-pcf"/>
1228-<mime-type type="application/x-font-speedo"/>
1229-<mime-type type="application/x-font-sunos-news"/>
1230-<mime-type type="application/x-font-tex"/>
1231-<mime-type type="application/x-font-tex-tfm"/>
1232-<mime-type type="application/x-font-ttf"/>
1233-<mime-type type="application/x-font-type1"/>
1234-<mime-type type="application/x-font-vfont"/>
1235-<mime-type type="application/x-frame"/>
1236-<mime-type type="application/x-gdbm"/>
1237-<mime-type type="application/x-geda-gsch2pcb-project"/>
1238-<mime-type type="application/x-geda-schematic"/>
1239-<mime-type type="application/x-geda-symbol"/>
1240-<mime-type type="application/x-gerber"/>
1241-<mime-type type="application/x-gettext-translation"/>
1242-<mime-type type="application/x-glade"/>
1243-<mime-type type="application/x-gmc-link"/>
1244-<mime-type type="application/x-gnome-app-info"/>
1245-<mime-type type="application/x-gnucash"/>
1246-<mime-type type="application/x-gnumeric"/>
1247-<mime-type type="application/x-graphite"/>
1248-<mime-type type="application/x-gtar"/>
1249-<mime-type type="application/x-gtktalog"/>
1250-<mime-type type="application/x-gzip"/>
1251-<mime-type type="application/x-gzpostscript"/>
1252-<mime-type type="application/x-hdf"/>
1253-<mime-type type="application/x-jar"/>
1254-<mime-type type="application/x-java"/>
1255-<mime-type type="application/x-java-jnlp-file"/>
1256-<mime-type type="application/x-jbuilder-project"/>
1257-<mime-type type="application/x-karbon"/>
1258-<mime-type type="application/x-kchart"/>
1259-<mime-type type="application/x-kformula"/>
1260-<mime-type type="application/x-killustrator"/>
1261-<mime-type type="application/x-kivio"/>
1262-<mime-type type="application/x-kontour"/>
1263-<mime-type type="application/x-kpovmodeler"/>
1264-<mime-type type="application/x-kpresenter"/>
1265-<mime-type type="application/x-krita"/>
1266-<mime-type type="application/x-kspread"/>
1267-<mime-type type="application/x-kspread-crypt"/>
1268-<mime-type type="application/x-ksysv-package"/>
1269-<mime-type type="application/x-kugar"/>
1270-<mime-type type="application/x-kword"/>
1271-<mime-type type="application/x-kword-crypt"/>
1272-<mime-type type="application/x-lha"/>
1273-<mime-type type="application/x-lhz"/>
1274-<mime-type type="application/x-linguist"/>
1275-<mime-type type="application/x-lyx"/>
1276-<mime-type type="application/x-lzop"/>
1277-<mime-type type="application/x-magicpoint"/>
1278-<mime-type type="application/x-matroska"/>
1279-<mime-type type="application/x-mif"/>
1280-<mime-type type="application/x-mozilla-bookmarks"/>
1281-<mime-type type="application/x-mswinurl"/>
1282-<mime-type type="application/x-mswrite"/>
1283-<mime-type type="application/x-nautilus-link"/>
1284-<mime-type type="application/x-netcdf"/>
1285-<mime-type type="application/x-netscape-bookmarks"/>
1286-<mime-type type="application/x-netshow-channel"/>
1287-<mime-type type="application/x-ogg"/>
1288-<mime-type type="application/x-oleo"/>
1289-<mime-type type="application/x-palm-database"/>
1290-<mime-type type="application/x-pcb-layout"/>
1291-<mime-type type="application/x-pcb-footprint"/>
1292-<mime-type type="application/x-pcb-netlist"/>
1293-<mime-type type="application/x-pdf"/>
1294-<mime-type type="application/x-php"/>
1295-<mime-type type="application/x-pkcs12"/>
1296-<mime-type type="application/x-profile"/>
1297-<mime-type type="application/x-pw"/>
1298-<mime-type type="application/x-quattropro"/>
1299-<mime-type type="application/x-quicktime-media-link"/>
1300-<mime-type type="application/x-quicktimeplayer"/>
1301-<mime-type type="application/x-qw"/>
1302-<mime-type type="application/x-rar"/>
1303-<mime-type type="application/x-reject"/>
1304-<mime-type type="application/x-rpm"/>
1305-<mime-type type="application/x-sc"/>
1306-<mime-type type="application/x-shar"/>
1307-<mime-type type="application/x-shared-library-la"/>
1308-<mime-type type="application/x-shockwave-flash"/>
1309-<mime-type type="application/x-siag"/>
1310-<mime-type type="application/x-sit"/>
1311-<mime-type type="application/x-slp"/>
1312-<mime-type type="application/x-smil"/>
1313-<mime-type type="application/x-stuffit"/>
1314-<mime-type type="application/x-sv4cpio"/>
1315-<mime-type type="application/x-sv4crc"/>
1316-<mime-type type="application/x-tar"/>
1317-<mime-type type="application/x-tarz"/>
1318-<mime-type type="application/x-tex-gf"/>
1319-<mime-type type="application/x-tex-pk"/>
1320-<mime-type type="application/x-tgif"/>
1321-<mime-type type="application/x-theme"/>
1322-<mime-type type="application/x-toutdoux"/>
1323-<mime-type type="application/x-trash"/>
1324-<mime-type type="application/x-troff"/>
1325-<mime-type type="application/x-troff-man"/>
1326-<mime-type type="application/x-troff-man-compressed"/>
1327-<mime-type type="application/x-tzo"/>
1328-<mime-type type="application/x-ustar"/>
1329-<mime-type type="application/x-wais-source"/>
1330-<mime-type type="application/x-wordperfect"/>
1331-<mime-type type="application/x-wpg"/>
1332-<mime-type type="application/x-x509-ca-cert"/>
1333-<mime-type type="application/x-xbel"/>
1334-<mime-type type="application/x-zerosize"/>
1335-<mime-type type="application/x-zip-compressed"/>
1336-<mime-type type="application/x-zoo"/>
1337-<mime-type type="application/xhtml+xml"/>
1338-<mime-type type="application/zip"/>
1339-<mime-type type="audio/ac3"/>
1340-<mime-type type="audio/AMR"/>
1341-<mime-type type="audio/AMR-WB"/>
1342-<mime-type type="audio/basic"/>
1343-<mime-type type="audio/midi"/>
1344-<mime-type type="audio/mpeg"/>
1345-<mime-type type="audio/mpegurl"/>
1346-<mime-type type="audio/ogg"/>
1347-<mime-type type="audio/playlist"/>
1348-<mime-type type="audio/prs.sid"/>
1349-<mime-type type="audio/vnd.rn-realaudio"/>
1350-<mime-type type="audio/vnd.wave"/>
1351-<mime-type type="audio/x-vorbis"/>
1352-<mime-type type="audio/wav"/>
1353-<mime-type type="audio/x-adpcm"/>
1354-<mime-type type="audio/x-aifc"/>
1355-<mime-type type="audio/x-aiff"/>
1356-<mime-type type="audio/x-aiffc"/>
1357-<mime-type type="audio/x-ape"/>
1358-<mime-type type="audio/x-flac"/>
1359-<mime-type type="audio/x-it"/>
1360-<mime-type type="audio/x-m4a"/>
1361-<mime-type type="audio/x-matroska"/>
1362-<mime-type type="audio/x-midi"/>
1363-<mime-type type="audio/x-mod"/>
1364-<mime-type type="audio/x-mp3"/>
1365-<mime-type type="audio/x-mp3-playlist"/>
1366-<mime-type type="audio/x-mpeg"/>
1367-<mime-type type="audio/x-mpegurl"/>
1368-<mime-type type="audio/x-ms-asx"/>
1369-<mime-type type="audio/x-ms-wax"/>
1370-<mime-type type="audio/x-musepack"/>
1371-<mime-type type="audio/x-pn-realaudio"/>
1372-<mime-type type="audio/x-pn-realaudio-plugin"/>
1373-<mime-type type="audio/x-realaudio"/>
1374-<mime-type type="audio/x-real-audio"/>
1375-<mime-type type="audio/x-riff"/>
1376-<mime-type type="audio/x-s3m"/>
1377-<mime-type type="audio/x-sbc"/>
1378-<mime-type type="audio/x-scpls"/>
1379-<mime-type type="audio/x-stm"/>
1380-<mime-type type="audio/x-tta"/>
1381-<mime-type type="audio/x-voc"/>
1382-<mime-type type="audio/x-wav"/>
1383-<mime-type type="audio/x-wavpack"/>
1384-<mime-type type="audio/x-xi"/>
1385-<mime-type type="audio/x-xm"/>
1386-<mime-type type="image/bmp"/>
1387-<mime-type type="image/cgm"/>
1388-<mime-type type="image/dpx"/>
1389-<mime-type type="image/fax-g3"/>
1390-<mime-type type="image/g3fax"/>
1391-<mime-type type="image/gif"/>
1392-<mime-type type="image/ief"/>
1393-<mime-type type="image/jpeg"/>
1394-<mime-type type="image/jpeg2000"/>
1395-<mime-type type="image/png"/>
1396-<mime-type type="image/rle"/>
1397-<mime-type type="image/svg+xml"/>
1398-<mime-type type="image/tiff"/>
1399-<mime-type type="image/vnd.djvu"/>
1400-<mime-type type="image/vnd.dwg"/>
1401-<mime-type type="image/vnd.dxf"/>
1402-<mime-type type="image/x-3ds"/>
1403-<mime-type type="image/x-applix-graphics"/>
1404-<mime-type type="image/x-cmu-raster"/>
1405-<mime-type type="image/x-compressed-xcf"/>
1406-<mime-type type="image/x-dcm"/>
1407-<mime-type type="image/x-dib"/>
1408-<mime-type type="image/x-djvu"/>
1409-<mime-type type="image/x-eps"/>
1410-<mime-type type="image/x-fits"/>
1411-<mime-type type="image/x-fpx"/>
1412-<mime-type type="image/x-icb"/>
1413-<mime-type type="image/x-ico"/>
1414-<mime-type type="image/x-iff"/>
1415-<mime-type type="image/x-ilbm"/>
1416-<mime-type type="image/x-jng"/>
1417-<mime-type type="image/x-lwo"/>
1418-<mime-type type="image/x-lws"/>
1419-<mime-type type="image/x-msod"/>
1420-<mime-type type="image/x-niff"/>
1421-<mime-type type="image/x-pcx"/>
1422-<mime-type type="image/x-photo-cd"/>
1423-<mime-type type="image/x-pict"/>
1424-<mime-type type="image/x-png"/>
1425-<mime-type type="image/x-portable-anymap"/>
1426-<mime-type type="image/x-portable-bitmap"/>
1427-<mime-type type="image/x-portable-graymap"/>
1428-<mime-type type="image/x-portable-pixmap"/>
1429-<mime-type type="image/x-psd"/>
1430-<mime-type type="image/x-rgb"/>
1431-<mime-type type="image/x-sgi"/>
1432-<mime-type type="image/x-sun-raster"/>
1433-<mime-type type="image/x-tga"/>
1434-<mime-type type="image/x-win-bitmap"/>
1435-<mime-type type="image/x-wmf"/>
1436-<mime-type type="image/x-xbitmap"/>
1437-<mime-type type="image/x-xcf"/>
1438-<mime-type type="image/x-xfig"/>
1439-<mime-type type="image/x-xpixmap"/>
1440-<mime-type type="image/x-xwindowdump"/>
1441-<mime-type type="message/delivery-status"/>
1442-<mime-type type="message/disposition-notification"/>
1443-<mime-type type="message/external-body"/>
1444-<mime-type type="message/news"/>
1445-<mime-type type="message/partial"/>
1446-<mime-type type="message/rfc822"/>
1447-<mime-type type="message/x-gnu-rmail"/>
1448-<mime-type type="model/vrml"/>
1449-<mime-type type="multipart/alternative"/>
1450-<mime-type type="multipart/appledouble"/>
1451-<mime-type type="multipart/digest"/>
1452-<mime-type type="multipart/encrypted"/>
1453-<mime-type type="multipart/mixed"/>
1454-<mime-type type="multipart/related"/>
1455-<mime-type type="multipart/report"/>
1456-<mime-type type="multipart/signed"/>
1457-<mime-type type="multipart/x-mixed-replace"/>
1458-<mime-type type="text/calendar"/>
1459-<mime-type type="text/css"/>
1460-<mime-type type="text/csv"/>
1461-<mime-type type="text/directory"/>
1462-<mime-type type="text/enriched"/>
1463-<mime-type type="text/google-video-pointer"/>
1464-<mime-type type="text/html"/>
1465-<mime-type type="text/htmlh"/>
1466-<mime-type type="text/mathml"/>
1467-<mime-type type="text/plain"/>
1468-<mime-type type="text/rdf"/>
1469-<mime-type type="text/rfc822-headers"/>
1470-<mime-type type="text/richtext"/>
1471-<mime-type type="text/rss"/>
1472-<mime-type type="text/rtf"/>
1473-<mime-type type="text/sgml"/>
1474-<mime-type type="text/spreadsheet"/>
1475-<mime-type type="text/tab-separated-values"/>
1476-<mime-type type="text/vnd.wap.wml"/>
1477-<mime-type type="text/x-adasrc"/>
1478-<mime-type type="text/x-authors"/>
1479-<mime-type type="text/x-bibtex"/>
1480-<mime-type type="text/x-c++hdr"/>
1481-<mime-type type="text/x-c++src"/>
1482-<mime-type type="text/x-chdr"/>
1483-<mime-type type="text/x-comma-separated-values"/>
1484-<mime-type type="text/x-copying"/>
1485-<mime-type type="text/x-credits"/>
1486-<mime-type type="text/x-csharp"/>
1487-<mime-type type="text/x-csrc"/>
1488-<mime-type type="text/x-dcl"/>
1489-<mime-type type="text/x-diff"/>
1490-<mime-type type="text/x-dsl"/>
1491-<mime-type type="text/x-dsrc"/>
1492-<mime-type type="text/x-dtd"/>
1493-<mime-type type="text/x-emacs-lisp"/>
1494-<mime-type type="text/x-fortran"/>
1495-<mime-type type="text/x-gettext-translation"/>
1496-<mime-type type="text/x-gettext-translation-template"/>
1497-<mime-type type="text/x-google-video-pointer"/>
1498-<mime-type type="text/x-gtkrc"/>
1499-<mime-type type="text/x-haskell"/>
1500-<mime-type type="text/x-idl"/>
1501-<mime-type type="text/x-install"/>
1502-<mime-type type="text/x-java"/>
1503-<mime-type type="text/x-ksysv-log"/>
1504-<mime-type type="text/x-literate-haskell"/>
1505-<mime-type type="text/x-log"/>
1506-<mime-type type="text/x-makefile"/>
1507-<mime-type type="text/x-moc"/>
1508-<mime-type type="text/x-objcsrc"/>
1509-<mime-type type="text/x-pascal"/>
1510-<mime-type type="text/x-patch"/>
1511-<mime-type type="text/x-python"/>
1512-<mime-type type="text/x-readme"/>
1513-<mime-type type="text/x-scheme"/>
1514-<mime-type type="text/x-setext"/>
1515-<mime-type type="text/x-speech"/>
1516-<mime-type type="text/x-sql"/>
1517-<mime-type type="text/x-tcl"/>
1518-<mime-type type="text/x-tex"/>
1519-<mime-type type="text/x-texinfo"/>
1520-<mime-type type="text/x-troff-me"/>
1521-<mime-type type="text/x-troff-mm"/>
1522-<mime-type type="text/x-troff-ms"/>
1523-<mime-type type="text/x-uil"/>
1524-<mime-type type="text/x-uri"/>
1525-<mime-type type="text/x-vcalendar"/>
1526-<mime-type type="text/x-vcard"/>
1527-<mime-type type="text/x-xmi"/>
1528-<mime-type type="text/x-xslfo"/>
1529-<mime-type type="text/x-xslt"/>
1530-<mime-type type="text/xmcd"/>
1531-<mime-type type="text/xml"/>
1532-<mime-type type="video/flv"/>
1533-<mime-type type="video/isivideo"/>
1534-<mime-type type="video/mp4"/>
1535-<mime-type type="video/mpeg"/>
1536-<mime-type type="video/quicktime"/>
1537-<mime-type type="video/vivo"/>
1538-<mime-type type="video/wavelet"/>
1539-<mime-type type="video/x-anim"/>
1540-<mime-type type="video/x-avi"/>
1541-<mime-type type="video/x-flic"/>
1542-<mime-type type="video/x-flv"/>
1543-<mime-type type="video/x-m4v"/>
1544-<mime-type type="video/x-matroska"/>
1545-<mime-type type="video/x-mng"/>
1546-<mime-type type="video/x-ms-asf"/>
1547-<mime-type type="video/x-ms-asf-plugin"/>
1548-<mime-type type="video/x-ms-wmv"/>
1549-<mime-type type="video/x-ms-wvx"/>
1550-<mime-type type="video/x-msvideo"/>
1551-<mime-type type="video/x-nsv"/>
1552-<mime-type type="video/x-ogm+ogg"/>
1553-<mime-type type="video/x-real-video"/>
1554-<mime-type type="video/x-theora+ogg"/>
1555-<mime-type type="video/x-sgi-movie"/>
1556-</safe>
1557-<unsafe>
1558-<mime-type type="application/mac-binhex40"/>
1559-<mime-type type="application/vnd.hp-hpgl"/>
1560-<mime-type type="application/vnd.hp-pcl"/>
1561-<mime-type type="application/vnd.mozilla.xul+xml"/>
1562-<mime-type type="application/vnd.palm"/>
1563-<mime-type type="application/x-arc"/>
1564-<mime-type type="application/x-awk"/>
1565-<mime-type type="application/x-class-file"/>
1566-<mime-type type="application/x-core"/>
1567-<mime-type type="application/x-csh"/>
1568-<mime-type type="application/x-dc-rom"/>
1569-<mime-type type="application/x-deb"/>
1570-<mime-type type="application/x-executable"/>
1571-<mime-type type="application/x-gameboy-rom"/>
1572-<mime-type type="application/x-genesis-rom"/>
1573-<mime-type type="application/x-ipod-firmware"/>
1574-<mime-type type="application/x-javascript"/>
1575-<mime-type type="application/x-macbinary"/>
1576-<mime-type type="application/x-mplayer2"/>
1577-<mime-type type="application/x-ms-dos-executable"/>
1578-<mime-type type="application/x-msx-rom"/>
1579-<mime-type type="application/x-n64-rom"/>
1580-<mime-type type="application/x-nes-rom"/>
1581-<mime-type type="application/x-object"/>
1582-<mime-type type="application/x-ole-storage"/>
1583-<mime-type type="application/x-par2"/>
1584-<mime-type type="application/x-pef-executable"/>
1585-<mime-type type="application/x-perl"/>
1586-<mime-type type="application/x-python"/>
1587-<mime-type type="application/x-python-bytecode"/>
1588-<mime-type type="application/x-ruby"/>
1589-<mime-type type="application/x-sharedlib"/>
1590-<mime-type type="application/x-shellscript"/>
1591-<mime-type type="application/x-sms-rom"/>
1592-<mime-type type="application/x-xpinstall"/>
1593-<mime-type type="inode/blockdevice"/>
1594-<mime-type type="inode/chardevice"/>
1595-<mime-type type="inode/directory"/>
1596-<mime-type type="inode/fifo"/>
1597-<mime-type type="inode/mount-point"/>
1598-<mime-type type="inode/socket"/>
1599-<mime-type type="inode/symlink"/>
1600-<mime-type type="text/x-ksh"/>
1601-</unsafe>
1602-</mime-types-permissions>
1603
1604=== added directory '.pc/81_ubuntu_force_update_bookmarks_menu.patch'
1605=== removed directory '.pc/81_ubuntu_force_update_bookmarks_menu.patch'
1606=== added file '.pc/81_ubuntu_force_update_bookmarks_menu.patch/.timestamp'
1607=== added directory '.pc/81_ubuntu_force_update_bookmarks_menu.patch/src'
1608=== removed directory '.pc/81_ubuntu_force_update_bookmarks_menu.patch/src'
1609=== added directory '.pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks'
1610=== removed directory '.pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks'
1611=== added file '.pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks/ephy-bookmarks-ui.c'
1612--- .pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks/ephy-bookmarks-ui.c 1970-01-01 00:00:00 +0000
1613+++ .pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks/ephy-bookmarks-ui.c 2015-06-24 21:42:56 +0000
1614@@ -0,0 +1,363 @@
1615+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
1616+/*
1617+ * Copyright © 2005 Peter Harvey
1618+ * Copyright © 2006 Christian Persch
1619+ *
1620+ * This program is free software; you can redistribute it and/or modify
1621+ * it under the terms of the GNU General Public License as published by
1622+ * the Free Software Foundation; either version 2, or (at your option)
1623+ * any later version.
1624+ *
1625+ * This program is distributed in the hope that it will be useful,
1626+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1627+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1628+ * GNU General Public License for more details.
1629+ *
1630+ * You should have received a copy of the GNU General Public License
1631+ * along with this program; if not, write to the Free Software
1632+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1633+ *
1634+ */
1635+
1636+#include "config.h"
1637+#include "ephy-bookmarks-ui.h"
1638+
1639+#include "ephy-bookmark-action-group.h"
1640+#include "ephy-bookmark-action.h"
1641+#include "ephy-bookmark-properties.h"
1642+#include "ephy-bookmarks-menu.h"
1643+#include "ephy-bookmarks.h"
1644+#include "ephy-debug.h"
1645+#include "ephy-dnd.h"
1646+#include "ephy-embed-shell.h"
1647+#include "ephy-file-helpers.h"
1648+#include "ephy-gui.h"
1649+#include "ephy-link.h"
1650+#include "ephy-node-common.h"
1651+#include "ephy-open-tabs-action.h"
1652+#include "ephy-prefs.h"
1653+#include "ephy-settings.h"
1654+#include "ephy-shell.h"
1655+#include "ephy-string.h"
1656+#include "ephy-topic-action-group.h"
1657+#include "ephy-topic-action.h"
1658+
1659+#include <string.h>
1660+#include <glib/gi18n.h>
1661+#include <gtk/gtk.h>
1662+
1663+#define BM_WINDOW_DATA_KEY "bookmarks-window-data"
1664+
1665+typedef struct
1666+{
1667+ guint bookmarks_menu;
1668+ guint toolbar_menu;
1669+} BookmarksWindowData;
1670+
1671+enum
1672+{
1673+ RESPONSE_SHOW_PROPERTIES = 1,
1674+ RESPONSE_NEW_BOOKMARK = 2
1675+};
1676+
1677+static GString * bookmarks_menu_string = 0;
1678+static GHashTable *properties_dialogs = 0;
1679+
1680+static GtkAction *
1681+find_action (GtkUIManager *manager, const char *name)
1682+{
1683+ GList *l = gtk_ui_manager_get_action_groups (manager);
1684+ GtkAction *action;
1685+
1686+ while (l != NULL)
1687+ {
1688+ action = gtk_action_group_get_action (GTK_ACTION_GROUP (l->data), name);
1689+ if (action) return action;
1690+ l = l->next;
1691+ }
1692+
1693+ return NULL;
1694+}
1695+
1696+static void
1697+activate_bookmarks_menu (GtkAction *action, EphyWindow *window)
1698+{
1699+ BookmarksWindowData *data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
1700+ if (data && !data->bookmarks_menu)
1701+ {
1702+ GtkUIManager *manager = ephy_window_get_ui_manager (window);
1703+ gtk_ui_manager_ensure_update (manager);
1704+
1705+ if (!bookmarks_menu_string->len)
1706+ {
1707+ g_string_append (bookmarks_menu_string,
1708+ "<ui><popup name=\"PagePopup\" action=\"PagePopupAction\"><menu name=\"BookmarksMenu\" action=\"Bookmarks\">");
1709+ ephy_bookmarks_menu_build (bookmarks_menu_string, 0);
1710+ g_string_append (bookmarks_menu_string, "</menu></popup></ui>");
1711+ }
1712+
1713+ data->bookmarks_menu = gtk_ui_manager_add_ui_from_string
1714+ (manager, bookmarks_menu_string->str, bookmarks_menu_string->len, 0);
1715+
1716+ gtk_ui_manager_ensure_update (manager);
1717+ }
1718+}
1719+
1720+static void
1721+erase_bookmarks_menu (EphyWindow *window)
1722+{
1723+ BookmarksWindowData *data;
1724+ GtkUIManager *manager;
1725+
1726+ manager = ephy_window_get_ui_manager (window);
1727+ data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
1728+
1729+ if (data != NULL && data->bookmarks_menu != 0)
1730+ {
1731+ gtk_ui_manager_remove_ui (manager, data->bookmarks_menu);
1732+ data->bookmarks_menu = 0;
1733+ }
1734+
1735+ g_string_truncate (bookmarks_menu_string, 0);
1736+}
1737+
1738+static void
1739+tree_changed_cb (EphyBookmarks *bookmarks,
1740+ EphyWindow *window)
1741+{
1742+ erase_bookmarks_menu (window);
1743+}
1744+
1745+static void
1746+node_added_cb (EphyNode *parent,
1747+ EphyNode *child,
1748+ EphyWindow *window)
1749+{
1750+ erase_bookmarks_menu (window);
1751+}
1752+
1753+static void
1754+node_changed_cb (EphyNode *parent,
1755+ EphyNode *child,
1756+ guint property_id,
1757+ EphyWindow *window)
1758+{
1759+ if (property_id == EPHY_NODE_KEYWORD_PROP_NAME ||
1760+ property_id == EPHY_NODE_BMK_PROP_TITLE)
1761+ {
1762+ erase_bookmarks_menu (window);
1763+ }
1764+}
1765+
1766+static void
1767+node_removed_cb (EphyNode *parent,
1768+ EphyNode *child,
1769+ guint index,
1770+ EphyWindow *window)
1771+{
1772+ erase_bookmarks_menu (window);
1773+}
1774+
1775+void
1776+ephy_bookmarks_ui_attach_window (EphyWindow *window)
1777+{
1778+ EphyBookmarks *eb;
1779+ EphyNode *bookmarks;
1780+ EphyNode *topics;
1781+ BookmarksWindowData *data;
1782+ GtkUIManager *manager;
1783+ GtkActionGroup *actions;
1784+ GtkAction *action;
1785+
1786+ eb = ephy_shell_get_bookmarks (ephy_shell_get_default ());
1787+ bookmarks = ephy_bookmarks_get_bookmarks (eb);
1788+ topics = ephy_bookmarks_get_keywords (eb);
1789+ data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
1790+ g_return_if_fail (data == NULL);
1791+
1792+ manager = ephy_window_get_ui_manager (window);
1793+
1794+ data = g_new0 (BookmarksWindowData, 1);
1795+ g_object_set_data_full (G_OBJECT (window), BM_WINDOW_DATA_KEY, data, g_free);
1796+
1797+ /* Create the self-maintaining action groups for bookmarks and topics */
1798+ actions = ephy_bookmark_group_new (bookmarks);
1799+ gtk_ui_manager_insert_action_group (manager, actions, -1);
1800+ g_signal_connect_object (actions, "open-link",
1801+ G_CALLBACK (ephy_link_open), G_OBJECT (window),
1802+ G_CONNECT_SWAPPED | G_CONNECT_AFTER);
1803+ g_object_unref (actions);
1804+
1805+ actions = ephy_topic_action_group_new (topics, manager);
1806+ gtk_ui_manager_insert_action_group (manager, actions, -1);
1807+ g_object_unref (actions);
1808+
1809+ actions = ephy_open_tabs_group_new (topics);
1810+ gtk_ui_manager_insert_action_group (manager, actions, -1);
1811+ g_signal_connect_object (actions, "open-link",
1812+ G_CALLBACK (ephy_link_open), G_OBJECT (window),
1813+ G_CONNECT_SWAPPED | G_CONNECT_AFTER);
1814+ g_object_unref (actions);
1815+
1816+ /* Add signal handlers for the bookmark database */
1817+ ephy_node_signal_connect_object (bookmarks, EPHY_NODE_CHILD_ADDED,
1818+ (EphyNodeCallback)node_added_cb,
1819+ G_OBJECT (window));
1820+ ephy_node_signal_connect_object (topics, EPHY_NODE_CHILD_ADDED,
1821+ (EphyNodeCallback)node_added_cb,
1822+ G_OBJECT (window));
1823+
1824+ ephy_node_signal_connect_object (bookmarks, EPHY_NODE_CHILD_REMOVED,
1825+ (EphyNodeCallback)node_removed_cb,
1826+ G_OBJECT (window));
1827+ ephy_node_signal_connect_object (topics, EPHY_NODE_CHILD_REMOVED,
1828+ (EphyNodeCallback)node_removed_cb,
1829+ G_OBJECT (window));
1830+
1831+ ephy_node_signal_connect_object (bookmarks, EPHY_NODE_CHILD_CHANGED,
1832+ (EphyNodeCallback)node_changed_cb,
1833+ G_OBJECT (window));
1834+ ephy_node_signal_connect_object (topics, EPHY_NODE_CHILD_CHANGED,
1835+ (EphyNodeCallback)node_changed_cb,
1836+ G_OBJECT (window));
1837+
1838+ g_signal_connect_object (eb, "tree_changed",
1839+ G_CALLBACK (tree_changed_cb),
1840+ G_OBJECT (window), 0);
1841+
1842+ /* Setup empty menu strings and add signal handlers to build the menus on demand */
1843+ if (!bookmarks_menu_string)
1844+ bookmarks_menu_string = g_string_new ("");
1845+
1846+ action = find_action (manager, "Bookmarks");
1847+ g_signal_connect_object (action, "activate",
1848+ G_CALLBACK (activate_bookmarks_menu),
1849+ G_OBJECT (window), 0);
1850+}
1851+
1852+void
1853+ephy_bookmarks_ui_detach_window (EphyWindow *window)
1854+{
1855+ EphyBookmarks *eb = ephy_shell_get_bookmarks (ephy_shell_get_default ());
1856+ EphyNode *bookmarks = ephy_bookmarks_get_bookmarks (eb);
1857+ EphyNode *topics = ephy_bookmarks_get_keywords (eb);
1858+
1859+ BookmarksWindowData *data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
1860+ GtkUIManager *manager = ephy_window_get_ui_manager (window);
1861+ GtkAction *action;
1862+
1863+ g_return_if_fail (data != 0);
1864+
1865+ if (data->bookmarks_menu)
1866+ gtk_ui_manager_remove_ui (manager, data->bookmarks_menu);
1867+
1868+ g_object_set_data (G_OBJECT (window), BM_WINDOW_DATA_KEY, 0);
1869+
1870+ ephy_node_signal_disconnect_object (bookmarks, EPHY_NODE_CHILD_ADDED,
1871+ (EphyNodeCallback)node_added_cb,
1872+ G_OBJECT (window));
1873+ ephy_node_signal_disconnect_object (topics, EPHY_NODE_CHILD_ADDED,
1874+ (EphyNodeCallback)node_added_cb,
1875+ G_OBJECT (window));
1876+
1877+ ephy_node_signal_disconnect_object (bookmarks, EPHY_NODE_CHILD_REMOVED,
1878+ (EphyNodeCallback)node_removed_cb,
1879+ G_OBJECT (window));
1880+ ephy_node_signal_disconnect_object (topics, EPHY_NODE_CHILD_REMOVED,
1881+ (EphyNodeCallback)node_removed_cb,
1882+ G_OBJECT (window));
1883+
1884+ ephy_node_signal_disconnect_object (bookmarks, EPHY_NODE_CHILD_CHANGED,
1885+ (EphyNodeCallback)node_changed_cb,
1886+ G_OBJECT (window));
1887+ ephy_node_signal_disconnect_object (topics, EPHY_NODE_CHILD_CHANGED,
1888+ (EphyNodeCallback)node_changed_cb,
1889+ G_OBJECT (window));
1890+
1891+ g_signal_handlers_disconnect_by_func
1892+ (G_OBJECT (eb), G_CALLBACK (tree_changed_cb), G_OBJECT (window));
1893+
1894+ action = find_action (manager, "Bookmarks");
1895+ g_signal_handlers_disconnect_by_func
1896+ (G_OBJECT (action), G_CALLBACK (activate_bookmarks_menu), G_OBJECT (window));
1897+}
1898+
1899+static void
1900+properties_dialog_destroy_cb (EphyBookmarkProperties *dialog,
1901+ EphyNode *bookmark)
1902+{
1903+ g_hash_table_remove (properties_dialogs, bookmark);
1904+}
1905+
1906+void
1907+ephy_bookmarks_ui_add_bookmark (GtkWindow *parent,
1908+ const char *location,
1909+ const char *title)
1910+{
1911+ EphyBookmarks *bookmarks;
1912+ EphyNode *bookmark;
1913+ GtkWidget *dialog;
1914+
1915+ if (g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN,
1916+ EPHY_PREFS_LOCKDOWN_BOOKMARK_EDITING))
1917+ return;
1918+
1919+ bookmarks = ephy_shell_get_bookmarks (ephy_shell_get_default ());
1920+ bookmark = ephy_bookmarks_add (bookmarks, title, location);
1921+
1922+ if (properties_dialogs == 0)
1923+ {
1924+ properties_dialogs = g_hash_table_new (g_direct_hash, g_direct_equal);
1925+ }
1926+
1927+ dialog = ephy_bookmark_properties_new (bookmarks, bookmark, TRUE);
1928+
1929+ g_assert (parent != NULL);
1930+
1931+ gtk_window_group_add_window (ephy_gui_ensure_window_group (parent),
1932+ GTK_WINDOW (dialog));
1933+ gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
1934+
1935+ g_signal_connect (dialog, "destroy",
1936+ G_CALLBACK (properties_dialog_destroy_cb), bookmark);
1937+ g_hash_table_insert (properties_dialogs,
1938+ bookmark, dialog);
1939+
1940+ gtk_window_present_with_time (GTK_WINDOW (dialog),
1941+ gtk_get_current_event_time ());
1942+}
1943+
1944+void
1945+ephy_bookmarks_ui_show_bookmark (EphyNode *bookmark)
1946+{
1947+ EphyBookmarks *bookmarks;
1948+ GtkWidget *dialog;
1949+
1950+ bookmarks = ephy_shell_get_bookmarks (ephy_shell_get_default ());
1951+
1952+ g_return_if_fail (EPHY_IS_BOOKMARKS (bookmarks));
1953+ g_return_if_fail (EPHY_IS_NODE (bookmark));
1954+
1955+ if (properties_dialogs == 0)
1956+ {
1957+ properties_dialogs = g_hash_table_new (g_direct_hash, g_direct_equal);
1958+ }
1959+
1960+ dialog = g_hash_table_lookup (properties_dialogs, bookmark);
1961+
1962+ if (dialog == NULL)
1963+ {
1964+ dialog = ephy_bookmark_properties_new (bookmarks, bookmark, FALSE);
1965+
1966+ g_signal_connect (dialog, "destroy",
1967+ G_CALLBACK (properties_dialog_destroy_cb), bookmark);
1968+ g_hash_table_insert (properties_dialogs,
1969+ bookmark, dialog);
1970+ }
1971+
1972+ gtk_window_present_with_time (GTK_WINDOW (dialog),
1973+ gtk_get_current_event_time ());
1974+}
1975+
1976+
1977+
1978
1979=== removed file '.pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks/ephy-bookmarks-ui.c'
1980--- .pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks/ephy-bookmarks-ui.c 2013-11-13 11:39:29 +0000
1981+++ .pc/81_ubuntu_force_update_bookmarks_menu.patch/src/bookmarks/ephy-bookmarks-ui.c 1970-01-01 00:00:00 +0000
1982@@ -1,363 +0,0 @@
1983-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
1984-/*
1985- * Copyright © 2005 Peter Harvey
1986- * Copyright © 2006 Christian Persch
1987- *
1988- * This program is free software; you can redistribute it and/or modify
1989- * it under the terms of the GNU General Public License as published by
1990- * the Free Software Foundation; either version 2, or (at your option)
1991- * any later version.
1992- *
1993- * This program is distributed in the hope that it will be useful,
1994- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1995- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1996- * GNU General Public License for more details.
1997- *
1998- * You should have received a copy of the GNU General Public License
1999- * along with this program; if not, write to the Free Software
2000- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2001- *
2002- */
2003-
2004-#include "config.h"
2005-#include "ephy-bookmarks-ui.h"
2006-
2007-#include "ephy-bookmark-action-group.h"
2008-#include "ephy-bookmark-action.h"
2009-#include "ephy-bookmark-properties.h"
2010-#include "ephy-bookmarks-menu.h"
2011-#include "ephy-bookmarks.h"
2012-#include "ephy-debug.h"
2013-#include "ephy-dnd.h"
2014-#include "ephy-embed-shell.h"
2015-#include "ephy-file-helpers.h"
2016-#include "ephy-gui.h"
2017-#include "ephy-link.h"
2018-#include "ephy-node-common.h"
2019-#include "ephy-open-tabs-action.h"
2020-#include "ephy-prefs.h"
2021-#include "ephy-settings.h"
2022-#include "ephy-shell.h"
2023-#include "ephy-string.h"
2024-#include "ephy-topic-action-group.h"
2025-#include "ephy-topic-action.h"
2026-
2027-#include <string.h>
2028-#include <glib/gi18n.h>
2029-#include <gtk/gtk.h>
2030-
2031-#define BM_WINDOW_DATA_KEY "bookmarks-window-data"
2032-
2033-typedef struct
2034-{
2035- guint bookmarks_menu;
2036- guint toolbar_menu;
2037-} BookmarksWindowData;
2038-
2039-enum
2040-{
2041- RESPONSE_SHOW_PROPERTIES = 1,
2042- RESPONSE_NEW_BOOKMARK = 2
2043-};
2044-
2045-static GString * bookmarks_menu_string = 0;
2046-static GHashTable *properties_dialogs = 0;
2047-
2048-static GtkAction *
2049-find_action (GtkUIManager *manager, const char *name)
2050-{
2051- GList *l = gtk_ui_manager_get_action_groups (manager);
2052- GtkAction *action;
2053-
2054- while (l != NULL)
2055- {
2056- action = gtk_action_group_get_action (GTK_ACTION_GROUP (l->data), name);
2057- if (action) return action;
2058- l = l->next;
2059- }
2060-
2061- return NULL;
2062-}
2063-
2064-static void
2065-activate_bookmarks_menu (GtkAction *action, EphyWindow *window)
2066-{
2067- BookmarksWindowData *data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
2068- if (data && !data->bookmarks_menu)
2069- {
2070- GtkUIManager *manager = ephy_window_get_ui_manager (window);
2071- gtk_ui_manager_ensure_update (manager);
2072-
2073- if (!bookmarks_menu_string->len)
2074- {
2075- g_string_append (bookmarks_menu_string,
2076- "<ui><popup name=\"PagePopup\" action=\"PagePopupAction\"><menu name=\"BookmarksMenu\" action=\"Bookmarks\">");
2077- ephy_bookmarks_menu_build (bookmarks_menu_string, 0);
2078- g_string_append (bookmarks_menu_string, "</menu></popup></ui>");
2079- }
2080-
2081- data->bookmarks_menu = gtk_ui_manager_add_ui_from_string
2082- (manager, bookmarks_menu_string->str, bookmarks_menu_string->len, 0);
2083-
2084- gtk_ui_manager_ensure_update (manager);
2085- }
2086-}
2087-
2088-static void
2089-erase_bookmarks_menu (EphyWindow *window)
2090-{
2091- BookmarksWindowData *data;
2092- GtkUIManager *manager;
2093-
2094- manager = ephy_window_get_ui_manager (window);
2095- data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
2096-
2097- if (data != NULL && data->bookmarks_menu != 0)
2098- {
2099- gtk_ui_manager_remove_ui (manager, data->bookmarks_menu);
2100- data->bookmarks_menu = 0;
2101- }
2102-
2103- g_string_truncate (bookmarks_menu_string, 0);
2104-}
2105-
2106-static void
2107-tree_changed_cb (EphyBookmarks *bookmarks,
2108- EphyWindow *window)
2109-{
2110- erase_bookmarks_menu (window);
2111-}
2112-
2113-static void
2114-node_added_cb (EphyNode *parent,
2115- EphyNode *child,
2116- EphyWindow *window)
2117-{
2118- erase_bookmarks_menu (window);
2119-}
2120-
2121-static void
2122-node_changed_cb (EphyNode *parent,
2123- EphyNode *child,
2124- guint property_id,
2125- EphyWindow *window)
2126-{
2127- if (property_id == EPHY_NODE_KEYWORD_PROP_NAME ||
2128- property_id == EPHY_NODE_BMK_PROP_TITLE)
2129- {
2130- erase_bookmarks_menu (window);
2131- }
2132-}
2133-
2134-static void
2135-node_removed_cb (EphyNode *parent,
2136- EphyNode *child,
2137- guint index,
2138- EphyWindow *window)
2139-{
2140- erase_bookmarks_menu (window);
2141-}
2142-
2143-void
2144-ephy_bookmarks_ui_attach_window (EphyWindow *window)
2145-{
2146- EphyBookmarks *eb;
2147- EphyNode *bookmarks;
2148- EphyNode *topics;
2149- BookmarksWindowData *data;
2150- GtkUIManager *manager;
2151- GtkActionGroup *actions;
2152- GtkAction *action;
2153-
2154- eb = ephy_shell_get_bookmarks (ephy_shell_get_default ());
2155- bookmarks = ephy_bookmarks_get_bookmarks (eb);
2156- topics = ephy_bookmarks_get_keywords (eb);
2157- data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
2158- g_return_if_fail (data == NULL);
2159-
2160- manager = ephy_window_get_ui_manager (window);
2161-
2162- data = g_new0 (BookmarksWindowData, 1);
2163- g_object_set_data_full (G_OBJECT (window), BM_WINDOW_DATA_KEY, data, g_free);
2164-
2165- /* Create the self-maintaining action groups for bookmarks and topics */
2166- actions = ephy_bookmark_group_new (bookmarks);
2167- gtk_ui_manager_insert_action_group (manager, actions, -1);
2168- g_signal_connect_object (actions, "open-link",
2169- G_CALLBACK (ephy_link_open), G_OBJECT (window),
2170- G_CONNECT_SWAPPED | G_CONNECT_AFTER);
2171- g_object_unref (actions);
2172-
2173- actions = ephy_topic_action_group_new (topics, manager);
2174- gtk_ui_manager_insert_action_group (manager, actions, -1);
2175- g_object_unref (actions);
2176-
2177- actions = ephy_open_tabs_group_new (topics);
2178- gtk_ui_manager_insert_action_group (manager, actions, -1);
2179- g_signal_connect_object (actions, "open-link",
2180- G_CALLBACK (ephy_link_open), G_OBJECT (window),
2181- G_CONNECT_SWAPPED | G_CONNECT_AFTER);
2182- g_object_unref (actions);
2183-
2184- /* Add signal handlers for the bookmark database */
2185- ephy_node_signal_connect_object (bookmarks, EPHY_NODE_CHILD_ADDED,
2186- (EphyNodeCallback)node_added_cb,
2187- G_OBJECT (window));
2188- ephy_node_signal_connect_object (topics, EPHY_NODE_CHILD_ADDED,
2189- (EphyNodeCallback)node_added_cb,
2190- G_OBJECT (window));
2191-
2192- ephy_node_signal_connect_object (bookmarks, EPHY_NODE_CHILD_REMOVED,
2193- (EphyNodeCallback)node_removed_cb,
2194- G_OBJECT (window));
2195- ephy_node_signal_connect_object (topics, EPHY_NODE_CHILD_REMOVED,
2196- (EphyNodeCallback)node_removed_cb,
2197- G_OBJECT (window));
2198-
2199- ephy_node_signal_connect_object (bookmarks, EPHY_NODE_CHILD_CHANGED,
2200- (EphyNodeCallback)node_changed_cb,
2201- G_OBJECT (window));
2202- ephy_node_signal_connect_object (topics, EPHY_NODE_CHILD_CHANGED,
2203- (EphyNodeCallback)node_changed_cb,
2204- G_OBJECT (window));
2205-
2206- g_signal_connect_object (eb, "tree_changed",
2207- G_CALLBACK (tree_changed_cb),
2208- G_OBJECT (window), 0);
2209-
2210- /* Setup empty menu strings and add signal handlers to build the menus on demand */
2211- if (!bookmarks_menu_string)
2212- bookmarks_menu_string = g_string_new ("");
2213-
2214- action = find_action (manager, "Bookmarks");
2215- g_signal_connect_object (action, "activate",
2216- G_CALLBACK (activate_bookmarks_menu),
2217- G_OBJECT (window), 0);
2218-}
2219-
2220-void
2221-ephy_bookmarks_ui_detach_window (EphyWindow *window)
2222-{
2223- EphyBookmarks *eb = ephy_shell_get_bookmarks (ephy_shell_get_default ());
2224- EphyNode *bookmarks = ephy_bookmarks_get_bookmarks (eb);
2225- EphyNode *topics = ephy_bookmarks_get_keywords (eb);
2226-
2227- BookmarksWindowData *data = g_object_get_data (G_OBJECT (window), BM_WINDOW_DATA_KEY);
2228- GtkUIManager *manager = ephy_window_get_ui_manager (window);
2229- GtkAction *action;
2230-
2231- g_return_if_fail (data != 0);
2232-
2233- if (data->bookmarks_menu)
2234- gtk_ui_manager_remove_ui (manager, data->bookmarks_menu);
2235-
2236- g_object_set_data (G_OBJECT (window), BM_WINDOW_DATA_KEY, 0);
2237-
2238- ephy_node_signal_disconnect_object (bookmarks, EPHY_NODE_CHILD_ADDED,
2239- (EphyNodeCallback)node_added_cb,
2240- G_OBJECT (window));
2241- ephy_node_signal_disconnect_object (topics, EPHY_NODE_CHILD_ADDED,
2242- (EphyNodeCallback)node_added_cb,
2243- G_OBJECT (window));
2244-
2245- ephy_node_signal_disconnect_object (bookmarks, EPHY_NODE_CHILD_REMOVED,
2246- (EphyNodeCallback)node_removed_cb,
2247- G_OBJECT (window));
2248- ephy_node_signal_disconnect_object (topics, EPHY_NODE_CHILD_REMOVED,
2249- (EphyNodeCallback)node_removed_cb,
2250- G_OBJECT (window));
2251-
2252- ephy_node_signal_disconnect_object (bookmarks, EPHY_NODE_CHILD_CHANGED,
2253- (EphyNodeCallback)node_changed_cb,
2254- G_OBJECT (window));
2255- ephy_node_signal_disconnect_object (topics, EPHY_NODE_CHILD_CHANGED,
2256- (EphyNodeCallback)node_changed_cb,
2257- G_OBJECT (window));
2258-
2259- g_signal_handlers_disconnect_by_func
2260- (G_OBJECT (eb), G_CALLBACK (tree_changed_cb), G_OBJECT (window));
2261-
2262- action = find_action (manager, "Bookmarks");
2263- g_signal_handlers_disconnect_by_func
2264- (G_OBJECT (action), G_CALLBACK (activate_bookmarks_menu), G_OBJECT (window));
2265-}
2266-
2267-static void
2268-properties_dialog_destroy_cb (EphyBookmarkProperties *dialog,
2269- EphyNode *bookmark)
2270-{
2271- g_hash_table_remove (properties_dialogs, bookmark);
2272-}
2273-
2274-void
2275-ephy_bookmarks_ui_add_bookmark (GtkWindow *parent,
2276- const char *location,
2277- const char *title)
2278-{
2279- EphyBookmarks *bookmarks;
2280- EphyNode *bookmark;
2281- GtkWidget *dialog;
2282-
2283- if (g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN,
2284- EPHY_PREFS_LOCKDOWN_BOOKMARK_EDITING))
2285- return;
2286-
2287- bookmarks = ephy_shell_get_bookmarks (ephy_shell_get_default ());
2288- bookmark = ephy_bookmarks_add (bookmarks, title, location);
2289-
2290- if (properties_dialogs == 0)
2291- {
2292- properties_dialogs = g_hash_table_new (g_direct_hash, g_direct_equal);
2293- }
2294-
2295- dialog = ephy_bookmark_properties_new (bookmarks, bookmark, TRUE);
2296-
2297- g_assert (parent != NULL);
2298-
2299- gtk_window_group_add_window (ephy_gui_ensure_window_group (parent),
2300- GTK_WINDOW (dialog));
2301- gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
2302-
2303- g_signal_connect (dialog, "destroy",
2304- G_CALLBACK (properties_dialog_destroy_cb), bookmark);
2305- g_hash_table_insert (properties_dialogs,
2306- bookmark, dialog);
2307-
2308- gtk_window_present_with_time (GTK_WINDOW (dialog),
2309- gtk_get_current_event_time ());
2310-}
2311-
2312-void
2313-ephy_bookmarks_ui_show_bookmark (EphyNode *bookmark)
2314-{
2315- EphyBookmarks *bookmarks;
2316- GtkWidget *dialog;
2317-
2318- bookmarks = ephy_shell_get_bookmarks (ephy_shell_get_default ());
2319-
2320- g_return_if_fail (EPHY_IS_BOOKMARKS (bookmarks));
2321- g_return_if_fail (EPHY_IS_NODE (bookmark));
2322-
2323- if (properties_dialogs == 0)
2324- {
2325- properties_dialogs = g_hash_table_new (g_direct_hash, g_direct_equal);
2326- }
2327-
2328- dialog = g_hash_table_lookup (properties_dialogs, bookmark);
2329-
2330- if (dialog == NULL)
2331- {
2332- dialog = ephy_bookmark_properties_new (bookmarks, bookmark, FALSE);
2333-
2334- g_signal_connect (dialog, "destroy",
2335- G_CALLBACK (properties_dialog_destroy_cb), bookmark);
2336- g_hash_table_insert (properties_dialogs,
2337- bookmark, dialog);
2338- }
2339-
2340- gtk_window_present_with_time (GTK_WINDOW (dialog),
2341- gtk_get_current_event_time ());
2342-}
2343-
2344-
2345-
2346
2347=== added file '.pc/applied-patches'
2348--- .pc/applied-patches 1970-01-01 00:00:00 +0000
2349+++ .pc/applied-patches 2015-06-24 21:42:56 +0000
2350@@ -0,0 +1,5 @@
2351+00_epiphany-browser.patch
2352+07_bookmarks.patch
2353+12_safetypes.patch
2354+81_ubuntu_force_update_bookmarks_menu.patch
2355+ubuntu_titlebars.patch
2356
2357=== removed file '.pc/applied-patches'
2358--- .pc/applied-patches 2014-12-21 10:19:27 +0000
2359+++ .pc/applied-patches 1970-01-01 00:00:00 +0000
2360@@ -1,5 +0,0 @@
2361-00_epiphany-browser.patch
2362-07_bookmarks.patch
2363-12_safetypes.patch
2364-81_ubuntu_force_update_bookmarks_menu.patch
2365-ubuntu_titlebars.patch
2366
2367=== added directory '.pc/ubuntu_titlebars.patch'
2368=== removed directory '.pc/ubuntu_titlebars.patch'
2369=== added file '.pc/ubuntu_titlebars.patch/.timestamp'
2370=== added directory '.pc/ubuntu_titlebars.patch/src'
2371=== removed directory '.pc/ubuntu_titlebars.patch/src'
2372=== added file '.pc/ubuntu_titlebars.patch/src/ephy-window.c'
2373--- .pc/ubuntu_titlebars.patch/src/ephy-window.c 1970-01-01 00:00:00 +0000
2374+++ .pc/ubuntu_titlebars.patch/src/ephy-window.c 2015-06-24 21:42:56 +0000
2375@@ -0,0 +1,4026 @@
2376+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2377+/*
2378+ * Copyright © 2000, 2001, 2002, 2003, 2004 Marco Pesenti Gritti
2379+ * Copyright © 2003, 2004 Christian Persch
2380+ * Copyright © 2011 Igalia S.L.
2381+ *
2382+ * This program is free software; you can redistribute it and/or modify
2383+ * it under the terms of the GNU General Public License as published by
2384+ * the Free Software Foundation; either version 2, or (at your option)
2385+ * any later version.
2386+ *
2387+ * This program is distributed in the hope that it will be useful,
2388+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2389+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2390+ * GNU General Public License for more details.
2391+ *
2392+ * You should have received a copy of the GNU General Public License
2393+ * along with this program; if not, write to the Free Software
2394+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2395+ *
2396+ */
2397+
2398+#include "config.h"
2399+#include "ephy-window.h"
2400+
2401+#include "ephy-action-helper.h"
2402+#include "ephy-bookmarks-ui.h"
2403+#include "ephy-certificate-popover.h"
2404+#include "ephy-combined-stop-reload-action.h"
2405+#include "ephy-debug.h"
2406+#include "ephy-download-widget.h"
2407+#include "ephy-embed-container.h"
2408+#include "ephy-embed-prefs.h"
2409+#include "ephy-embed-shell.h"
2410+#include "ephy-embed-type-builtins.h"
2411+#include "ephy-embed-utils.h"
2412+#include "ephy-encoding-menu.h"
2413+#include "ephy-file-helpers.h"
2414+#include "ephy-find-toolbar.h"
2415+#include "ephy-gui.h"
2416+#include "ephy-home-action.h"
2417+#include "ephy-initial-state.h"
2418+#include "ephy-link.h"
2419+#include "ephy-location-entry.h"
2420+#include "ephy-navigation-history-action.h"
2421+#include "ephy-notebook.h"
2422+#include "ephy-prefs.h"
2423+#include "ephy-private.h"
2424+#include "ephy-session.h"
2425+#include "ephy-settings.h"
2426+#include "ephy-shell.h"
2427+#include "ephy-title-box.h"
2428+#include "ephy-toolbar.h"
2429+#include "ephy-type-builtins.h"
2430+#include "ephy-web-view.h"
2431+#include "ephy-zoom-action.h"
2432+#include "ephy-zoom.h"
2433+#include "popup-commands.h"
2434+#include "window-commands.h"
2435+
2436+#include <gdk/gdkkeysyms.h>
2437+#include <gdk/gdkx.h>
2438+#include <gio/gio.h>
2439+#include <glib/gi18n.h>
2440+#include <gtk/gtk.h>
2441+#include <libsoup/soup.h>
2442+
2443+#define WNCK_I_KNOW_THIS_IS_UNSTABLE
2444+#include <libwnck/libwnck.h>
2445+
2446+#include <webkit2/webkit2.h>
2447+
2448+#ifdef HAVE_X11_XF86KEYSYM_H
2449+#include <X11/XF86keysym.h>
2450+#endif
2451+
2452+/**
2453+ * SECTION:ephy-window
2454+ * @short_description: Epiphany's main #GtkWindow widget
2455+ *
2456+ * #EphyWindow is Epiphany's main widget.
2457+ */
2458+
2459+static void ephy_window_view_popup_windows_cb (GtkAction *action,
2460+ EphyWindow *window);
2461+
2462+static const GtkActionEntry ephy_menu_entries [] = {
2463+
2464+ /* Toplevel */
2465+
2466+ { "Bookmarks", NULL, N_("_Bookmarks") },
2467+ { "PopupAction", NULL, "" },
2468+ { "PagePopupAction", NULL, "" },
2469+ { "NotebookPopupAction", NULL, "" },
2470+
2471+ /* File actions. */
2472+
2473+ { "FileNewWindow", NULL, N_("_New Window"), "<control>N", NULL,
2474+ G_CALLBACK (window_cmd_file_new_window) },
2475+ { "FileNewWindowIncognito", NULL, N_("New _Incognito Window"), "<control><shift>N", NULL,
2476+ G_CALLBACK (window_cmd_file_new_incognito_window) },
2477+ { "FileOpen", NULL, N_("_Open…"), "<control>O", NULL,
2478+ G_CALLBACK (window_cmd_file_open) },
2479+ { "FileSaveAs", NULL, N_("Save _As…"), "<shift><control>S", NULL,
2480+ G_CALLBACK (window_cmd_file_save_as) },
2481+ { "FileSaveAsApplication", NULL, N_("Save As _Web Application…"), "<shift><control>A", NULL,
2482+ G_CALLBACK (window_cmd_file_save_as_application) },
2483+ { "FilePrint", NULL, N_("_Print…"), "<control>P", NULL,
2484+ G_CALLBACK (window_cmd_file_print) },
2485+ { "FileSendTo", NULL, N_("S_end Link by Email…"), NULL, NULL,
2486+ G_CALLBACK (window_cmd_file_send_to) },
2487+ { "FileCloseTab", NULL, N_("_Close"), "<control>W", NULL,
2488+ G_CALLBACK (window_cmd_file_close_window) },
2489+ { "FileQuit", NULL, N_("_Quit"), "<control>Q", NULL,
2490+ G_CALLBACK (window_cmd_file_quit) },
2491+
2492+ /* Edit actions. */
2493+
2494+ { "EditUndo", NULL, N_("_Undo"), "<control>Z", NULL,
2495+ G_CALLBACK (window_cmd_edit_undo) },
2496+ { "EditRedo", NULL, N_("Re_do"), "<shift><control>Z", NULL,
2497+ G_CALLBACK (window_cmd_edit_redo) },
2498+ { "EditCut", NULL, N_("Cu_t"), "<control>X", NULL,
2499+ G_CALLBACK (window_cmd_edit_cut) },
2500+ { "EditCopy", NULL, N_("_Copy"), "<control>C", NULL,
2501+ G_CALLBACK (window_cmd_edit_copy) },
2502+ { "EditPaste", NULL, N_("_Paste"), "<control>V", NULL,
2503+ G_CALLBACK (window_cmd_edit_paste) },
2504+ { "EditDelete", NULL, NULL, NULL, NULL,
2505+ G_CALLBACK (window_cmd_edit_delete) },
2506+ { "EditSelectAll", NULL, N_("Select _All"), "<control>A", NULL,
2507+ G_CALLBACK (window_cmd_edit_select_all) },
2508+ { "EditFind", NULL, N_("_Find…"), "<control>F", NULL,
2509+ G_CALLBACK (window_cmd_edit_find) },
2510+ { "EditFindNext", NULL, N_("Find Ne_xt"), "<control>G", NULL,
2511+ G_CALLBACK (window_cmd_edit_find_next) },
2512+ { "EditFindPrev", NULL, N_("Find Pre_vious"), "<shift><control>G", NULL,
2513+ G_CALLBACK (window_cmd_edit_find_prev) },
2514+ { "EditBookmarks", NULL, N_("Edit _Bookmarks"), "<control>B", NULL,
2515+ G_CALLBACK (window_cmd_edit_bookmarks) },
2516+ { "EditHistory", NULL, N_("_History"), "<control>H", NULL,
2517+ G_CALLBACK (window_cmd_edit_history) },
2518+ { "EditPreferences", NULL, N_("Pr_eferences"), "<control>e", NULL,
2519+ G_CALLBACK (window_cmd_edit_preferences) },
2520+
2521+ /* View actions. */
2522+
2523+ { "ViewStop", NULL, N_("_Stop"), "Escape", NULL,
2524+ G_CALLBACK (window_cmd_view_stop) },
2525+ { "ViewAlwaysStop", NULL, N_("_Stop"), "Escape",
2526+ NULL, G_CALLBACK (window_cmd_view_stop) },
2527+ { "ViewReload", NULL, N_("_Reload"), "<control>R", NULL,
2528+ G_CALLBACK (window_cmd_view_reload) },
2529+ { "ViewZoomIn", NULL, N_("Zoom _In"), "<control>plus", NULL,
2530+ G_CALLBACK (window_cmd_view_zoom_in) },
2531+ { "ViewZoomOut", NULL, N_("Zoom O_ut"), "<control>minus", NULL,
2532+ G_CALLBACK (window_cmd_view_zoom_out) },
2533+ { "ViewZoomNormal", NULL, N_("_Normal Size"), "<control>0", NULL,
2534+ G_CALLBACK (window_cmd_view_zoom_normal) },
2535+ { "ViewEncoding", NULL, N_("Text _Encoding"), NULL, NULL, NULL },
2536+ { "ViewPageSource", NULL, N_("_Page Source"), "<control>U", NULL,
2537+ G_CALLBACK (window_cmd_view_page_source) },
2538+
2539+ /* Bookmarks actions. */
2540+
2541+ { "FileBookmarkPage", NULL, N_("_Add Bookmark…"), "<control>D", NULL,
2542+ G_CALLBACK (window_cmd_file_bookmark_page) },
2543+
2544+ /* Go actions. */
2545+
2546+ { "GoLocation", NULL, N_("_Location…"), "<control>L", NULL,
2547+ G_CALLBACK (window_cmd_go_location) },
2548+
2549+ /* Tabs actions. */
2550+
2551+ { "TabsPrevious", NULL, N_("_Previous Tab"), "<control>Page_Up", NULL,
2552+ G_CALLBACK (window_cmd_tabs_previous) },
2553+ { "TabsNext", NULL, N_("_Next Tab"), "<control>Page_Down", NULL,
2554+ G_CALLBACK (window_cmd_tabs_next) },
2555+ { "TabsMoveLeft", NULL, N_("Move Tab _Left"), "<shift><control>Page_Up", NULL,
2556+ G_CALLBACK (window_cmd_tabs_move_left) },
2557+ { "TabsMoveRight", NULL, N_("Move Tab _Right"), "<shift><control>Page_Down", NULL,
2558+ G_CALLBACK (window_cmd_tabs_move_right) },
2559+ { "TabsDetach", NULL, N_("_Detach Tab"), NULL, NULL,
2560+ G_CALLBACK (window_cmd_tabs_detach) },
2561+
2562+ /* Help. */
2563+
2564+ { "HelpContents", NULL, N_("_Help"), NULL, NULL,
2565+ G_CALLBACK (window_cmd_help_contents) },
2566+ { "HelpAbout", NULL, N_("_About"), NULL, NULL,
2567+ G_CALLBACK (window_cmd_help_about) }
2568+};
2569+
2570+static const GtkToggleActionEntry ephy_menu_toggle_entries [] =
2571+{
2572+ /* View actions. */
2573+
2574+ { "ViewDownloadsBar", NULL, N_("_Downloads Bar"), NULL, NULL,
2575+ NULL, FALSE },
2576+
2577+ { "ViewFullscreen", NULL, N_("_Fullscreen"), "F11", NULL,
2578+ G_CALLBACK (window_cmd_view_fullscreen), FALSE },
2579+ { "ViewPopupWindows", NULL, N_("Popup _Windows"), NULL, NULL,
2580+ G_CALLBACK (ephy_window_view_popup_windows_cb), FALSE },
2581+ { "BrowseWithCaret", NULL, N_("Selection Caret"), "F7", NULL,
2582+ G_CALLBACK (window_cmd_browse_with_caret), FALSE }
2583+};
2584+
2585+static const GtkActionEntry ephy_popups_entries [] = {
2586+ /* Document. */
2587+
2588+ { "ContextBookmarkPage", NULL, N_("Add Boo_kmark…"), "<control>D", NULL,
2589+ G_CALLBACK (window_cmd_file_bookmark_page) },
2590+
2591+ /* Links. */
2592+
2593+ { "OpenLinkInNewWindow", NULL, N_("Open Link in New _Window"), NULL, NULL,
2594+ G_CALLBACK (popup_cmd_link_in_new_window) },
2595+ { "OpenLinkInNewTab", NULL, N_("Open Link in New _Tab"), NULL, NULL,
2596+ G_CALLBACK (popup_cmd_link_in_new_tab) },
2597+ { "DownloadLinkAs", NULL, N_("_Save Link As…"), NULL, NULL,
2598+ G_CALLBACK (popup_cmd_download_link_as) },
2599+ { "CopyLinkAddress", NULL, N_("_Copy Link Address"), NULL,
2600+ NULL, G_CALLBACK (popup_cmd_copy_link_address) },
2601+ { "CopyEmailAddress", NULL, N_("_Copy E-mail Address"), NULL,
2602+ NULL, G_CALLBACK (popup_cmd_copy_link_address) },
2603+
2604+ /* Images. */
2605+
2606+ { "ViewImage", NULL, N_("View _Image in New Tab"), NULL,
2607+ NULL, G_CALLBACK (popup_cmd_view_image_in_new_tab) },
2608+ { "CopyImageLocation", NULL, N_("Copy I_mage Address"), NULL,
2609+ NULL, G_CALLBACK (popup_cmd_copy_image_location) },
2610+ { "SaveImageAs", NULL, N_("_Save Image As…"), NULL,
2611+ NULL, G_CALLBACK (popup_cmd_save_image_as) },
2612+ { "SetImageAsBackground", NULL, N_("Set as _Wallpaper"), NULL,
2613+ NULL, G_CALLBACK (popup_cmd_set_image_as_background) },
2614+
2615+ /* Video. */
2616+
2617+ { "OpenVideoInNewWindow", NULL, N_("Open Video in New _Window"), NULL, NULL,
2618+ G_CALLBACK (popup_cmd_media_in_new_window) },
2619+ { "OpenVideoInNewTab", NULL, N_("Open Video in New _Tab"), NULL, NULL,
2620+ G_CALLBACK (popup_cmd_media_in_new_tab) },
2621+ { "SaveVideoAs", NULL, N_("_Save Video As…"), NULL,
2622+ NULL, G_CALLBACK (popup_cmd_save_media_as) },
2623+ { "CopyVideoLocation", NULL, N_("_Copy Video Address"), NULL,
2624+ NULL, G_CALLBACK (popup_cmd_copy_media_location) },
2625+
2626+ /* Audio. */
2627+
2628+ { "OpenAudioInNewWindow", NULL, N_("Open Audio in New _Window"), NULL, NULL,
2629+ G_CALLBACK (popup_cmd_media_in_new_window) },
2630+ { "OpenAudioInNewTab", NULL, N_("Open Audio in New _Tab"), NULL, NULL,
2631+ G_CALLBACK (popup_cmd_media_in_new_tab) },
2632+ { "SaveAudioAs", NULL, N_("_Save Audio As…"), NULL,
2633+ NULL, G_CALLBACK (popup_cmd_save_media_as) },
2634+ { "CopyAudioLocation", NULL, N_("_Copy Audio Address"), NULL,
2635+ NULL, G_CALLBACK (popup_cmd_copy_media_location) },
2636+};
2637+
2638+static const struct
2639+{
2640+ guint keyval;
2641+ GdkModifierType modifier;
2642+ const gchar *action;
2643+ gboolean fromToolbar;
2644+} extra_keybindings [] = {
2645+ /* FIXME: PageMenu should have its accel without being in the
2646+ * extra keybindings, but does not seem to work for some
2647+ * reason. */
2648+ { GDK_KEY_F10, 0, "PageMenu", TRUE },
2649+ { GDK_KEY_Home, GDK_MOD1_MASK, "FileHome", TRUE },
2650+ /* FIXME: these are not in any menu for now, so add them here. */
2651+ { GDK_KEY_F11, 0, "ViewFullscreen", FALSE },
2652+ { GDK_KEY_plus, GDK_CONTROL_MASK, "ViewZoomIn", FALSE },
2653+ { GDK_KEY_minus, GDK_CONTROL_MASK, "ViewZoomOut", FALSE },
2654+ { GDK_KEY_0, GDK_CONTROL_MASK, "ViewZoomNormal", FALSE },
2655+ { GDK_KEY_g, GDK_CONTROL_MASK, "EditFindNext", FALSE },
2656+ { GDK_KEY_G, GDK_CONTROL_MASK |
2657+ GDK_SHIFT_MASK, "EditFindPrev", FALSE },
2658+
2659+ { GDK_KEY_s, GDK_CONTROL_MASK, "FileSaveAs", FALSE },
2660+ { GDK_KEY_r, GDK_CONTROL_MASK, "ViewReload", FALSE },
2661+ { GDK_KEY_R, GDK_CONTROL_MASK, "ViewReload", FALSE },
2662+ { GDK_KEY_R, GDK_CONTROL_MASK |
2663+ GDK_SHIFT_MASK, "ViewReload", FALSE },
2664+ /* Tab navigation */
2665+ { GDK_KEY_Page_Up, GDK_CONTROL_MASK, "TabsPrevious", FALSE },
2666+ { GDK_KEY_Page_Down, GDK_CONTROL_MASK, "TabsNext", FALSE },
2667+ { GDK_KEY_Page_Up, GDK_CONTROL_MASK |
2668+ GDK_SHIFT_MASK, "TabsMoveLeft", FALSE },
2669+ { GDK_KEY_Page_Down, GDK_CONTROL_MASK |
2670+ GDK_SHIFT_MASK, "TabsMoveRight", FALSE },
2671+ /* Go */
2672+ { GDK_KEY_l, GDK_CONTROL_MASK, "GoLocation", FALSE },
2673+ { GDK_KEY_F6, 0, "GoLocation", FALSE },
2674+ /* Support all the MSIE tricks as well ;) */
2675+ { GDK_KEY_F5, 0, "ViewReload", FALSE },
2676+ { GDK_KEY_F5, GDK_CONTROL_MASK, "ViewReload", FALSE },
2677+ { GDK_KEY_F5, GDK_SHIFT_MASK, "ViewReload", FALSE },
2678+ { GDK_KEY_F5, GDK_CONTROL_MASK |
2679+ GDK_SHIFT_MASK, "ViewReload", FALSE },
2680+ { GDK_KEY_KP_Add, GDK_CONTROL_MASK, "ViewZoomIn", FALSE },
2681+ { GDK_KEY_KP_Subtract, GDK_CONTROL_MASK, "ViewZoomOut", FALSE },
2682+ { GDK_KEY_equal, GDK_CONTROL_MASK, "ViewZoomIn", FALSE },
2683+ { GDK_KEY_KP_0, GDK_CONTROL_MASK, "ViewZoomNormal", FALSE },
2684+ /* These keys are a bit strange: when pressed with no modifiers, they emit
2685+ * KP_PageUp/Down Control; when pressed with Control+Shift they are KP_9/3,
2686+ * when NumLock is on they are KP_9/3 and with NumLock and Control+Shift
2687+ * They're KP_PageUp/Down again!
2688+ */
2689+ { GDK_KEY_Left, GDK_MOD1_MASK /*Alt*/, "NavigationBack", TRUE },
2690+ { GDK_KEY_KP_Left, GDK_MOD1_MASK /*Alt*/, "NavigationBack", TRUE },
2691+ { GDK_KEY_KP_4, GDK_MOD1_MASK /*Alt*/, "NavigationBack", TRUE },
2692+ { GDK_KEY_Right, GDK_MOD1_MASK /*Alt*/, "NavigationForward", TRUE },
2693+ { GDK_KEY_KP_Right, GDK_MOD1_MASK /*Alt*/, "NavigationForward", TRUE },
2694+ { GDK_KEY_KP_6, GDK_MOD1_MASK /*Alt*/, "NavigationForward", TRUE },
2695+ { GDK_KEY_KP_Page_Up, GDK_CONTROL_MASK, "TabsPrevious", FALSE },
2696+ { GDK_KEY_KP_9, GDK_CONTROL_MASK, "TabsPrevious", FALSE },
2697+ { GDK_KEY_KP_Page_Down, GDK_CONTROL_MASK, "TabsNext", FALSE },
2698+ { GDK_KEY_KP_3, GDK_CONTROL_MASK, "TabsNext", FALSE },
2699+ { GDK_KEY_KP_Page_Up, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "TabsMoveLeft", FALSE },
2700+ { GDK_KEY_KP_9, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "TabsMoveLeft", FALSE },
2701+ { GDK_KEY_KP_Page_Down, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "TabsMoveRight", FALSE },
2702+ { GDK_KEY_KP_3, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "TabsMoveRight", FALSE },
2703+#ifdef HAVE_X11_XF86KEYSYM_H
2704+ { XF86XK_Back, 0, "NavigationBack", TRUE },
2705+ { XF86XK_Forward, 0, "NavigationForward", TRUE },
2706+ { XF86XK_Go, 0, "GoLocation", FALSE },
2707+ { XF86XK_OpenURL, 0, "GoLocation", FALSE },
2708+ { XF86XK_AddFavorite, 0, "FileBookmarkPage", FALSE },
2709+ { XF86XK_Refresh, 0, "ViewReload", FALSE },
2710+ { XF86XK_Reload, 0, "ViewReload", FALSE },
2711+ { XF86XK_Search, 0, "EditFind", FALSE },
2712+ { XF86XK_Send, 0, "FileSendTo", FALSE },
2713+ { XF86XK_Stop, 0, "ViewStop", FALSE },
2714+ { XF86XK_ZoomIn, 0, "ViewZoomIn", FALSE },
2715+ { XF86XK_ZoomOut, 0, "ViewZoomOut", FALSE }
2716+ /* FIXME: what about ScrollUp, ScrollDown, Menu*, Option, LogOff, Save,.. any others? */
2717+#endif /* HAVE_X11_XF86KEYSYM_H */
2718+};
2719+
2720+#define SETTINGS_CONNECTION_DATA_KEY "EphyWindowSettings"
2721+
2722+#define EPHY_WINDOW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_WINDOW, EphyWindowPrivate))
2723+
2724+struct _EphyWindowPrivate
2725+{
2726+ GtkWidget *main_vbox;
2727+ GtkWidget *toolbar;
2728+ GtkUIManager *manager;
2729+ GtkActionGroup *action_group;
2730+ GtkActionGroup *popups_action_group;
2731+ GtkActionGroup *toolbar_action_group;
2732+ GtkActionGroup *tab_accels_action_group;
2733+ EphyEncodingMenu *enc_menu;
2734+ GtkNotebook *notebook;
2735+ EphyEmbed *active_embed;
2736+ EphyWindowChrome chrome;
2737+ EphyEmbedEvent *context_event;
2738+ WebKitHitTestResult *hit_test_result;
2739+ guint idle_worker;
2740+ GtkWidget *downloads_box;
2741+
2742+ EphyLocationController *location_controller;
2743+
2744+ gulong app_menu_visibility_handler;
2745+
2746+ guint closing : 1;
2747+ guint has_size : 1;
2748+ guint fullscreen_mode : 1;
2749+ guint is_popup : 1;
2750+ guint present_on_insert : 1;
2751+ guint key_theme_is_emacs : 1;
2752+ guint updating_address : 1;
2753+ guint force_close : 1;
2754+ guint checking_modified_forms : 1;
2755+};
2756+
2757+enum
2758+{
2759+ PROP_0,
2760+ PROP_ACTIVE_CHILD,
2761+ PROP_CHROME,
2762+ PROP_SINGLE_TAB_MODE
2763+};
2764+
2765+/* Make sure not to overlap with those in ephy-lockdown.c */
2766+enum
2767+{
2768+ SENS_FLAG_CHROME = 1 << 0,
2769+ SENS_FLAG_CONTEXT = 1 << 1,
2770+ SENS_FLAG_DOCUMENT = 1 << 2,
2771+ SENS_FLAG_LOADING = 1 << 3,
2772+ SENS_FLAG_NAVIGATION = 1 << 4,
2773+ SENS_FLAG_IS_BLANK = 1 << 5
2774+};
2775+
2776+static gint
2777+impl_add_child (EphyEmbedContainer *container,
2778+ EphyEmbed *child,
2779+ gint position,
2780+ gboolean jump_to)
2781+{
2782+ EphyWindow *window = EPHY_WINDOW (container);
2783+
2784+ g_return_val_if_fail (!window->priv->is_popup ||
2785+ gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->priv->notebook)) < 1, -1);
2786+
2787+ return ephy_notebook_add_tab (EPHY_NOTEBOOK (window->priv->notebook),
2788+ child, position, jump_to);
2789+}
2790+
2791+static void
2792+impl_set_active_child (EphyEmbedContainer *container,
2793+ EphyEmbed *child)
2794+{
2795+ int page;
2796+ EphyWindow *window;
2797+
2798+ window = EPHY_WINDOW (container);
2799+
2800+ page = gtk_notebook_page_num
2801+ (window->priv->notebook, GTK_WIDGET (child));
2802+ gtk_notebook_set_current_page
2803+ (window->priv->notebook, page);
2804+}
2805+
2806+static GtkWidget *
2807+construct_confirm_close_dialog (EphyWindow *window,
2808+ const char *title,
2809+ const char *info,
2810+ const char *action)
2811+{
2812+ GtkWidget *dialog;
2813+
2814+ dialog = gtk_message_dialog_new (GTK_WINDOW (window),
2815+ GTK_DIALOG_MODAL,
2816+ GTK_MESSAGE_WARNING,
2817+ GTK_BUTTONS_CANCEL,
2818+ "%s", title);
2819+
2820+ gtk_message_dialog_format_secondary_text
2821+ (GTK_MESSAGE_DIALOG (dialog), "%s", info);
2822+
2823+ gtk_dialog_add_button (GTK_DIALOG (dialog),
2824+ action, GTK_RESPONSE_ACCEPT);
2825+
2826+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
2827+
2828+ /* FIXME gtk_window_set_title (GTK_WINDOW (dialog), _("Close Document?")); */
2829+ gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (window)),
2830+ GTK_WINDOW (dialog));
2831+
2832+ return dialog;
2833+}
2834+
2835+static gboolean
2836+confirm_close_with_modified_forms (EphyWindow *window)
2837+{
2838+ GtkWidget *dialog;
2839+ int response;
2840+
2841+ dialog = construct_confirm_close_dialog (window,
2842+ _("There are unsubmitted changes to form elements"),
2843+ _("If you close the document anyway, "
2844+ "you will lose that information."),
2845+ _("Close _Document"));
2846+ response = gtk_dialog_run (GTK_DIALOG (dialog));
2847+
2848+ gtk_widget_destroy (dialog);
2849+
2850+ return response == GTK_RESPONSE_ACCEPT;
2851+}
2852+
2853+static gboolean
2854+confirm_close_with_downloads (EphyWindow *window)
2855+{
2856+ GtkWidget *dialog;
2857+ int response;
2858+
2859+ dialog = construct_confirm_close_dialog (window,
2860+ _("There are ongoing downloads in this window"),
2861+ _("If you close this window, the downloads will be cancelled"),
2862+ _("Close window and cancel downloads"));
2863+ response = gtk_dialog_run (GTK_DIALOG (dialog));
2864+
2865+ gtk_widget_destroy (dialog);
2866+
2867+ return response == GTK_RESPONSE_ACCEPT;
2868+}
2869+
2870+static void
2871+impl_remove_child (EphyEmbedContainer *container,
2872+ EphyEmbed *child)
2873+{
2874+ EphyWindow *window;
2875+
2876+ window = EPHY_WINDOW (container);
2877+ g_signal_emit_by_name (window->priv->notebook,
2878+ "tab-close-request",
2879+ child, window);
2880+}
2881+
2882+static EphyEmbed *
2883+impl_get_active_child (EphyEmbedContainer *container)
2884+{
2885+ return EPHY_WINDOW (container)->priv->active_embed;
2886+}
2887+
2888+static GList *
2889+impl_get_children (EphyEmbedContainer *container)
2890+{
2891+ EphyWindow *window = EPHY_WINDOW (container);
2892+
2893+ return gtk_container_get_children (GTK_CONTAINER (window->priv->notebook));
2894+}
2895+
2896+static gboolean
2897+impl_get_is_popup (EphyEmbedContainer *container)
2898+{
2899+ return EPHY_WINDOW (container)->priv->is_popup;
2900+}
2901+
2902+static void
2903+ephy_window_embed_container_iface_init (EphyEmbedContainerIface *iface)
2904+{
2905+ iface->add_child = impl_add_child;
2906+ iface->set_active_child = impl_set_active_child;
2907+ iface->remove_child = impl_remove_child;
2908+ iface->get_active_child = impl_get_active_child;
2909+ iface->get_children = impl_get_children;
2910+ iface->get_is_popup = impl_get_is_popup;
2911+}
2912+
2913+static EphyEmbed *
2914+ephy_window_open_link (EphyLink *link,
2915+ const char *address,
2916+ EphyEmbed *embed,
2917+ EphyLinkFlags flags)
2918+{
2919+ EphyWindow *window = EPHY_WINDOW (link);
2920+ EphyWindowPrivate *priv = window->priv;
2921+ EphyEmbed *new_embed;
2922+
2923+ g_return_val_if_fail (address != NULL, NULL);
2924+
2925+ if (embed == NULL)
2926+ {
2927+ embed = window->priv->active_embed;
2928+ }
2929+
2930+ if (flags & EPHY_LINK_BOOKMARK)
2931+ ephy_web_view_set_visit_type (ephy_embed_get_web_view (embed),
2932+ EPHY_PAGE_VISIT_BOOKMARK);
2933+ else if (flags & EPHY_LINK_TYPED)
2934+ ephy_web_view_set_visit_type (ephy_embed_get_web_view (embed),
2935+ EPHY_PAGE_VISIT_TYPED);
2936+
2937+ if (flags & (EPHY_LINK_JUMP_TO |
2938+ EPHY_LINK_NEW_TAB |
2939+ EPHY_LINK_NEW_WINDOW))
2940+ {
2941+ EphyNewTabFlags ntflags = 0;
2942+ EphyWindow *target_window = EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (embed)));
2943+
2944+ if (flags & EPHY_LINK_JUMP_TO)
2945+ {
2946+ ntflags |= EPHY_NEW_TAB_JUMP;
2947+ }
2948+
2949+ if (flags & EPHY_LINK_NEW_WINDOW ||
2950+ (flags & EPHY_LINK_NEW_TAB && priv->is_popup))
2951+ {
2952+ target_window = ephy_window_new ();
2953+ }
2954+
2955+ if (flags & EPHY_LINK_NEW_TAB_APPEND_AFTER)
2956+ ntflags |= EPHY_NEW_TAB_APPEND_AFTER;
2957+
2958+ new_embed = ephy_shell_new_tab
2959+ (ephy_shell_get_default (),
2960+ target_window,
2961+ embed, ntflags);
2962+ if (flags & EPHY_LINK_HOME_PAGE)
2963+ {
2964+ ephy_web_view_load_homepage (ephy_embed_get_web_view (new_embed));
2965+ ephy_window_activate_location (window);
2966+ }
2967+ else
2968+ {
2969+ ephy_web_view_load_url (ephy_embed_get_web_view (new_embed), address);
2970+ if (flags & EPHY_LINK_JUMP_TO)
2971+ {
2972+ gtk_widget_grab_focus (GTK_WIDGET (new_embed));
2973+ }
2974+ }
2975+ }
2976+ else
2977+ {
2978+ ephy_web_view_load_url (ephy_embed_get_web_view (embed), address);
2979+
2980+ if (address == NULL || address[0] == '\0' || g_str_equal (address, "about:blank"))
2981+ {
2982+ ephy_window_activate_location (window);
2983+ }
2984+ else
2985+ {
2986+ gtk_widget_grab_focus (GTK_WIDGET (embed));
2987+ }
2988+
2989+ new_embed = embed;
2990+ }
2991+
2992+ return new_embed;
2993+}
2994+
2995+static void
2996+ephy_window_link_iface_init (EphyLinkIface *iface)
2997+{
2998+ iface->open_link = ephy_window_open_link;
2999+}
3000+
3001+G_DEFINE_TYPE_WITH_CODE (EphyWindow, ephy_window, GTK_TYPE_APPLICATION_WINDOW,
3002+ G_IMPLEMENT_INTERFACE (EPHY_TYPE_LINK,
3003+ ephy_window_link_iface_init)
3004+ G_IMPLEMENT_INTERFACE (EPHY_TYPE_EMBED_CONTAINER,
3005+ ephy_window_embed_container_iface_init))
3006+
3007+static void
3008+settings_change_notify (GtkSettings *settings,
3009+ EphyWindow *window)
3010+{
3011+ EphyWindowPrivate *priv = window->priv;
3012+ char *key_theme_name;
3013+
3014+ g_object_get (settings,
3015+ "gtk-key-theme-name", &key_theme_name,
3016+ NULL);
3017+
3018+ priv->key_theme_is_emacs =
3019+ key_theme_name &&
3020+ g_ascii_strcasecmp (key_theme_name, "Emacs") == 0;
3021+
3022+ g_free (key_theme_name);
3023+}
3024+
3025+static void
3026+settings_changed_cb (GtkSettings *settings)
3027+{
3028+ GList *list, *l;
3029+
3030+ /* FIXME: multi-head */
3031+ list = gtk_window_list_toplevels ();
3032+
3033+ for (l = list; l != NULL; l = l->next)
3034+ {
3035+ if (EPHY_IS_WINDOW (l->data))
3036+ {
3037+ settings_change_notify (settings, l->data);
3038+ }
3039+ }
3040+
3041+ g_list_free (list);
3042+}
3043+
3044+static void
3045+sync_chromes_visibility (EphyWindow *window)
3046+{
3047+ EphyWindowPrivate *priv = window->priv;
3048+ gboolean show_tabsbar, show_downloads_box;
3049+
3050+ if (priv->closing)
3051+ return;
3052+
3053+ show_tabsbar = (priv->chrome & EPHY_WINDOW_CHROME_TABSBAR);
3054+ show_downloads_box = (priv->chrome & EPHY_WINDOW_CHROME_DOWNLOADS_BOX);
3055+
3056+ ephy_notebook_set_tabs_allowed (EPHY_NOTEBOOK (priv->notebook),
3057+ show_tabsbar && !(priv->is_popup || priv->fullscreen_mode));
3058+ gtk_widget_set_visible (priv->downloads_box,
3059+ show_downloads_box && !priv->fullscreen_mode);
3060+}
3061+
3062+static void
3063+ephy_window_set_chrome (EphyWindow *window,
3064+ EphyWindowChrome chrome)
3065+{
3066+ if (window->priv->chrome == chrome)
3067+ return;
3068+
3069+ window->priv->chrome = chrome;
3070+ if (window->priv->closing)
3071+ return;
3072+
3073+ g_object_notify (G_OBJECT (window), "chrome");
3074+ sync_chromes_visibility (window);
3075+}
3076+
3077+static void
3078+sync_tab_load_status (EphyWebView *view,
3079+ WebKitLoadEvent load_event,
3080+ EphyWindow *window)
3081+{
3082+ EphyWindowPrivate *priv = window->priv;
3083+ GtkActionGroup *action_group = priv->action_group;
3084+ GtkAction *action;
3085+ gboolean loading;
3086+
3087+ if (window->priv->closing) return;
3088+
3089+ loading = ephy_web_view_is_loading (view);
3090+
3091+ action = gtk_action_group_get_action (action_group, "ViewStop");
3092+ gtk_action_set_sensitive (action, loading);
3093+
3094+ /* disable print while loading, see bug #116344 */
3095+ action = gtk_action_group_get_action (action_group, "FilePrint");
3096+ ephy_action_change_sensitivity_flags (action, SENS_FLAG_LOADING, loading);
3097+
3098+ action = gtk_action_group_get_action (priv->toolbar_action_group,
3099+ "ViewCombinedStopReload");
3100+ ephy_combined_stop_reload_action_set_loading (EPHY_COMBINED_STOP_RELOAD_ACTION (action),
3101+ loading);
3102+}
3103+
3104+static void
3105+sync_tab_security (EphyWebView *view,
3106+ GParamSpec *pspec,
3107+ EphyWindow *window)
3108+{
3109+ EphyWindowPrivate *priv = window->priv;
3110+ EphyTitleBox *title_box;
3111+ EphySecurityLevel security_level;
3112+
3113+ if (priv->closing) return;
3114+
3115+ ephy_web_view_get_security_level (view, &security_level, NULL, NULL);
3116+ title_box = ephy_toolbar_get_title_box (EPHY_TOOLBAR (priv->toolbar));
3117+ ephy_title_box_set_security_level (title_box, security_level);
3118+}
3119+
3120+static void
3121+ephy_window_fullscreen (EphyWindow *window)
3122+{
3123+ EphyWindowPrivate *priv = window->priv;
3124+ EphyEmbed *embed;
3125+
3126+ priv->fullscreen_mode = TRUE;
3127+
3128+ /* sync status */
3129+ embed = window->priv->active_embed;
3130+ sync_tab_load_status (ephy_embed_get_web_view (embed), WEBKIT_LOAD_STARTED, window);
3131+ sync_tab_security (ephy_embed_get_web_view (embed), NULL, window);
3132+
3133+ sync_chromes_visibility (window);
3134+ gtk_widget_hide (priv->toolbar);
3135+ ephy_embed_entering_fullscreen (embed);
3136+}
3137+
3138+static void
3139+ephy_window_unfullscreen (EphyWindow *window)
3140+{
3141+ window->priv->fullscreen_mode = FALSE;
3142+
3143+ gtk_widget_show (window->priv->toolbar);
3144+ sync_chromes_visibility (window);
3145+ ephy_embed_leaving_fullscreen (window->priv->active_embed);
3146+}
3147+
3148+static gboolean
3149+ephy_window_key_press_event (GtkWidget *widget,
3150+ GdkEventKey *event)
3151+{
3152+ EphyWindow *window = EPHY_WINDOW (widget);
3153+ EphyWindowPrivate *priv = window->priv;
3154+ GtkWidget *focus_widget;
3155+ gboolean shortcircuit = FALSE, force_chain = FALSE, handled = FALSE;
3156+ guint modifier = event->state & gtk_accelerator_get_default_mod_mask ();
3157+ guint i;
3158+
3159+ /* In an attempt to get the mozembed playing nice with things like emacs keybindings
3160+ * we are passing important events to the focused child widget before letting the window's
3161+ * base handler see them. This is *completely against* stated gtk2 policy but the
3162+ * 'correct' behaviour is exceptionally useless. We need to keep an eye out for
3163+ * unexpected consequences of this decision. IME's should be a high concern, but
3164+ * considering that the IME folks complained about the upside-down event propagation
3165+ * rules, we might be doing them a favour.
3166+ *
3167+ * We achieve this by first evaluating the event to see if it's important, and if
3168+ * so, we get the focus widget and attempt to get the widget to handle that event.
3169+ * If the widget does handle it, we're done (unless force_chain is true, in which
3170+ * case the event is handled as normal in addition to being sent to the focus
3171+ * widget), otherwise the event follows the normal handling path.
3172+ */
3173+
3174+ if (event->keyval == GDK_KEY_Escape && modifier == 0)
3175+ {
3176+ /* Always pass Escape to both the widget, and the parent */
3177+ shortcircuit = TRUE;
3178+ force_chain = TRUE;
3179+ }
3180+ else if (priv->key_theme_is_emacs &&
3181+ (modifier == GDK_CONTROL_MASK) &&
3182+ event->length > 0 &&
3183+ /* But don't pass Ctrl+Enter twice */
3184+ event->keyval != GDK_KEY_Return &&
3185+ event->keyval != GDK_KEY_KP_Enter &&
3186+ event->keyval != GDK_KEY_ISO_Enter)
3187+ {
3188+ /* Pass CTRL+letter characters to the widget */
3189+ shortcircuit = TRUE;
3190+ }
3191+
3192+ if (shortcircuit)
3193+ {
3194+ focus_widget = gtk_window_get_focus (GTK_WINDOW (window));
3195+
3196+ if (GTK_IS_WIDGET (focus_widget))
3197+ {
3198+ handled = gtk_widget_event (focus_widget,
3199+ (GdkEvent*) event);
3200+ }
3201+
3202+ if (handled && !force_chain)
3203+ {
3204+ return handled;
3205+ }
3206+ }
3207+
3208+ /* Handle accelerators that we want bound, but aren't associated with
3209+ * an action */
3210+ for (i = 0; i < G_N_ELEMENTS (extra_keybindings); i++)
3211+ {
3212+ if (event->keyval == extra_keybindings[i].keyval &&
3213+ modifier == extra_keybindings[i].modifier)
3214+ {
3215+ GtkAction * action = gtk_action_group_get_action
3216+ (extra_keybindings[i].fromToolbar ?
3217+ priv->toolbar_action_group :
3218+ priv->action_group,
3219+ extra_keybindings[i].action);
3220+ if (gtk_action_is_sensitive (action))
3221+ {
3222+ gtk_action_activate (action);
3223+ return TRUE;
3224+ }
3225+ break;
3226+ }
3227+ }
3228+
3229+ return GTK_WIDGET_CLASS (ephy_window_parent_class)->key_press_event (widget, event);
3230+}
3231+
3232+static gboolean
3233+window_has_ongoing_downloads (EphyWindow *window)
3234+{
3235+ GList *l, *downloads;
3236+ gboolean downloading = FALSE;
3237+
3238+ downloads = gtk_container_get_children (GTK_CONTAINER (window->priv->downloads_box));
3239+
3240+ for (l = downloads; l != NULL; l = l->next)
3241+ {
3242+ if (EPHY_IS_DOWNLOAD_WIDGET (l->data) != TRUE)
3243+ continue;
3244+
3245+ if (!ephy_download_widget_download_is_finished (EPHY_DOWNLOAD_WIDGET (l->data)))
3246+ {
3247+ downloading = TRUE;
3248+ break;
3249+ }
3250+ }
3251+ g_list_free (downloads);
3252+
3253+ return downloading;
3254+}
3255+
3256+static gboolean
3257+ephy_window_delete_event (GtkWidget *widget,
3258+ GdkEventAny *event)
3259+{
3260+ if (!ephy_window_close (EPHY_WINDOW (widget)))
3261+ return TRUE;
3262+
3263+ /* proceed with window close */
3264+ if (GTK_WIDGET_CLASS (ephy_window_parent_class)->delete_event)
3265+ {
3266+ return GTK_WIDGET_CLASS (ephy_window_parent_class)->delete_event (widget, event);
3267+ }
3268+
3269+ return FALSE;
3270+}
3271+
3272+#define MAX_SPELL_CHECK_GUESSES 4
3273+
3274+static void
3275+update_link_actions_sensitivity (EphyWindow *window,
3276+ gboolean link_has_web_scheme)
3277+{
3278+ GtkAction *action;
3279+ GtkActionGroup *action_group;
3280+
3281+ action_group = window->priv->popups_action_group;
3282+
3283+ action = gtk_action_group_get_action (action_group, "OpenLinkInNewWindow");
3284+ gtk_action_set_sensitive (action, link_has_web_scheme);
3285+
3286+ action = gtk_action_group_get_action (action_group, "OpenLinkInNewTab");
3287+ ephy_action_change_sensitivity_flags (action, SENS_FLAG_CONTEXT, !link_has_web_scheme);
3288+}
3289+
3290+static void
3291+update_edit_action_sensitivity (EphyWindow *window, const gchar *action_name, gboolean sensitive, gboolean hide)
3292+{
3293+ GtkAction *action;
3294+
3295+ action = gtk_action_group_get_action (window->priv->action_group, action_name);
3296+ gtk_action_set_sensitive (action, sensitive);
3297+ gtk_action_set_visible (action, !hide || sensitive);
3298+}
3299+
3300+typedef struct
3301+{
3302+ EphyWindow *window;
3303+ const gchar *action_name;
3304+ gboolean hide;
3305+} CanEditCommandAsyncData;
3306+
3307+static CanEditCommandAsyncData *
3308+can_edit_command_async_data_new (EphyWindow *window, const gchar *action_name, gboolean hide)
3309+{
3310+ CanEditCommandAsyncData *data;
3311+
3312+ data = g_slice_new (CanEditCommandAsyncData);
3313+ data->window = g_object_ref (window);
3314+ data->action_name = action_name;
3315+ data->hide = hide;
3316+
3317+ return data;
3318+}
3319+
3320+static void
3321+can_edit_command_async_data_free (CanEditCommandAsyncData *data)
3322+{
3323+ if (G_UNLIKELY (!data))
3324+ return;
3325+
3326+ g_object_unref (data->window);
3327+ g_slice_free (CanEditCommandAsyncData, data);
3328+}
3329+
3330+static void
3331+can_edit_command_callback (GObject *object, GAsyncResult *result, CanEditCommandAsyncData *data)
3332+{
3333+ gboolean sensitive;
3334+ GError *error = NULL;
3335+
3336+ sensitive = webkit_web_view_can_execute_editing_command_finish (WEBKIT_WEB_VIEW (object), result, &error);
3337+ if (!error)
3338+ {
3339+ update_edit_action_sensitivity (data->window, data->action_name, sensitive, data->hide);
3340+
3341+ }
3342+ else
3343+ {
3344+ g_error_free (error);
3345+ }
3346+
3347+ can_edit_command_async_data_free (data);
3348+}
3349+
3350+static void
3351+update_edit_actions_sensitivity (EphyWindow *window, gboolean hide)
3352+{
3353+ GtkWidget *widget = gtk_window_get_focus (GTK_WINDOW (window));
3354+ gboolean can_copy, can_cut, can_undo, can_redo, can_paste;
3355+
3356+ if (GTK_IS_EDITABLE (widget))
3357+ {
3358+ GtkWidget *entry;
3359+ gboolean has_selection;
3360+
3361+ entry = ephy_toolbar_get_location_entry (EPHY_TOOLBAR (window->priv->toolbar));
3362+
3363+ has_selection = gtk_editable_get_selection_bounds
3364+ (GTK_EDITABLE (widget), NULL, NULL);
3365+
3366+ can_copy = has_selection;
3367+ can_cut = has_selection;
3368+ can_paste = TRUE;
3369+ can_undo = ephy_location_entry_get_can_undo (EPHY_LOCATION_ENTRY (entry));
3370+ can_redo = ephy_location_entry_get_can_redo (EPHY_LOCATION_ENTRY (entry));
3371+ }
3372+ else
3373+ {
3374+ EphyEmbed *embed;
3375+ WebKitWebView *view;
3376+ CanEditCommandAsyncData *data;
3377+
3378+ embed = window->priv->active_embed;
3379+ g_return_if_fail (embed != NULL);
3380+
3381+ view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
3382+
3383+ data = can_edit_command_async_data_new (window, "EditCopy", hide);
3384+ webkit_web_view_can_execute_editing_command (view, WEBKIT_EDITING_COMMAND_COPY, NULL,
3385+ (GAsyncReadyCallback)can_edit_command_callback,
3386+ data);
3387+ data = can_edit_command_async_data_new (window, "EditCut", hide);
3388+ webkit_web_view_can_execute_editing_command (view, WEBKIT_EDITING_COMMAND_CUT, NULL,
3389+ (GAsyncReadyCallback)can_edit_command_callback,
3390+ data);
3391+ data = can_edit_command_async_data_new (window, "EditPaste", hide);
3392+ webkit_web_view_can_execute_editing_command (view, WEBKIT_EDITING_COMMAND_PASTE, NULL,
3393+ (GAsyncReadyCallback)can_edit_command_callback,
3394+ data);
3395+ data = can_edit_command_async_data_new (window, "EditUndo", hide);
3396+ webkit_web_view_can_execute_editing_command (view, "Undo", NULL,
3397+ (GAsyncReadyCallback)can_edit_command_callback,
3398+ data);
3399+ data = can_edit_command_async_data_new (window, "EditRedo", hide);
3400+ webkit_web_view_can_execute_editing_command (view, "Redo", NULL,
3401+ (GAsyncReadyCallback)can_edit_command_callback,
3402+ data);
3403+ return;
3404+ }
3405+
3406+ update_edit_action_sensitivity (window, "EditCopy", can_copy, hide);
3407+ update_edit_action_sensitivity (window, "EditCut", can_cut, hide);
3408+ update_edit_action_sensitivity (window, "EditPaste", can_paste, hide);
3409+ update_edit_action_sensitivity (window, "EditUndo", can_undo, hide);
3410+ update_edit_action_sensitivity (window, "EditRedo", can_redo, hide);
3411+}
3412+
3413+static void
3414+enable_edit_actions_sensitivity (EphyWindow *window)
3415+{
3416+ GtkActionGroup *action_group;
3417+ GtkAction *action;
3418+
3419+ action_group = window->priv->action_group;
3420+
3421+ action = gtk_action_group_get_action (action_group, "EditCopy");
3422+ gtk_action_set_sensitive (action, TRUE);
3423+ gtk_action_set_visible (action, TRUE);
3424+ action = gtk_action_group_get_action (action_group, "EditCut");
3425+ gtk_action_set_sensitive (action, TRUE);
3426+ gtk_action_set_visible (action, TRUE);
3427+ action = gtk_action_group_get_action (action_group, "EditPaste");
3428+ gtk_action_set_sensitive (action, TRUE);
3429+ gtk_action_set_visible (action, TRUE);
3430+ action = gtk_action_group_get_action (action_group, "EditUndo");
3431+ gtk_action_set_sensitive (action, TRUE);
3432+ gtk_action_set_visible (action, TRUE);
3433+ action = gtk_action_group_get_action (action_group, "EditRedo");
3434+ gtk_action_set_sensitive (action, TRUE);
3435+ gtk_action_set_visible (action, TRUE);
3436+}
3437+
3438+static void
3439+edit_menu_show_cb (GtkWidget *menu,
3440+ EphyWindow *window)
3441+{
3442+ update_edit_actions_sensitivity (window, FALSE);
3443+}
3444+
3445+static void
3446+edit_menu_hide_cb (GtkWidget *menu,
3447+ EphyWindow *window)
3448+{
3449+ enable_edit_actions_sensitivity (window);
3450+}
3451+
3452+static void
3453+init_menu_updaters (EphyWindow *window)
3454+{
3455+ GtkWidget *edit_menu;
3456+
3457+ edit_menu = gtk_ui_manager_get_widget
3458+ (window->priv->manager, "/ui/PagePopup");
3459+
3460+ g_signal_connect (edit_menu, "show",
3461+ G_CALLBACK (edit_menu_show_cb), window);
3462+ g_signal_connect (edit_menu, "hide",
3463+ G_CALLBACK (edit_menu_hide_cb), window);
3464+}
3465+
3466+static void
3467+setup_ui_manager (EphyWindow *window)
3468+{
3469+ GtkActionGroup *action_group;
3470+ GtkAccelGroup *accel_group;
3471+ GtkAction *action;
3472+ GtkUIManager *manager;
3473+
3474+ window->priv->main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
3475+ gtk_widget_show (window->priv->main_vbox);
3476+ gtk_container_add (GTK_CONTAINER (window),
3477+ window->priv->main_vbox);
3478+
3479+ manager = gtk_ui_manager_new ();
3480+ accel_group = gtk_ui_manager_get_accel_group (manager);
3481+
3482+ action_group = gtk_action_group_new ("WindowActions");
3483+ gtk_action_group_set_translation_domain (action_group, NULL);
3484+ gtk_action_group_add_actions (action_group, ephy_menu_entries,
3485+ G_N_ELEMENTS (ephy_menu_entries), window);
3486+ gtk_action_group_add_toggle_actions (action_group,
3487+ ephy_menu_toggle_entries,
3488+ G_N_ELEMENTS (ephy_menu_toggle_entries),
3489+ window);
3490+ gtk_action_group_set_accel_group (action_group, accel_group);
3491+ gtk_ui_manager_insert_action_group (manager, action_group, 0);
3492+ window->priv->action_group = action_group;
3493+ g_object_unref (action_group);
3494+
3495+ action = gtk_action_group_get_action (action_group, "FileOpen");
3496+ g_object_set (action, "short_label", _("Open"), NULL);
3497+ action = gtk_action_group_get_action (action_group, "FileSaveAs");
3498+ g_object_set (action, "short_label", _("Save As"), NULL);
3499+ action = gtk_action_group_get_action (action_group, "FileSaveAsApplication");
3500+ g_object_set (action, "short_label", _("Save As Application"), NULL);
3501+ action = gtk_action_group_get_action (action_group, "FilePrint");
3502+ g_object_set (action, "short_label", _("Print"), NULL);
3503+ action = gtk_action_group_get_action (action_group, "FileBookmarkPage");
3504+ g_object_set (action, "short_label", _("Bookmark"), NULL);
3505+ action = gtk_action_group_get_action (action_group, "EditFind");
3506+ g_object_set (action, "short_label", _("Find"), NULL);
3507+
3508+ action = gtk_action_group_get_action (action_group, "EditFind");
3509+ g_object_set (action, "is_important", TRUE, NULL);
3510+
3511+ action = gtk_action_group_get_action (action_group, "ViewEncoding");
3512+ g_object_set (action, "hide_if_empty", FALSE, NULL);
3513+ action = gtk_action_group_get_action (action_group, "ViewZoomIn");
3514+ /* Translators: This refers to text size */
3515+ g_object_set (action, "short-label", _("Larger"), NULL);
3516+ action = gtk_action_group_get_action (action_group, "ViewZoomOut");
3517+ /* Translators: This refers to text size */
3518+ g_object_set (action, "short-label", _("Smaller"), NULL);
3519+
3520+ action_group = gtk_action_group_new ("PopupsActions");
3521+ gtk_action_group_set_translation_domain (action_group, NULL);
3522+ gtk_action_group_add_actions (action_group, ephy_popups_entries,
3523+ G_N_ELEMENTS (ephy_popups_entries), window);
3524+ gtk_action_group_set_accel_group (action_group, accel_group);
3525+ gtk_ui_manager_insert_action_group (manager, action_group, 0);
3526+ window->priv->popups_action_group = action_group;
3527+ g_object_unref (action_group);
3528+
3529+ /* Tab accels */
3530+ action_group = gtk_action_group_new ("TabAccelsActions");
3531+ gtk_action_group_set_accel_group (action_group, accel_group);
3532+ gtk_ui_manager_insert_action_group (manager, action_group, 0);
3533+ window->priv->tab_accels_action_group = action_group;
3534+ g_object_unref (action_group);
3535+
3536+ action_group = gtk_action_group_new ("SpecialToolbarActions");
3537+ action =
3538+ g_object_new (EPHY_TYPE_NAVIGATION_HISTORY_ACTION,
3539+ "name", "NavigationBack",
3540+ "label", _("Back"),
3541+ "icon-name", "go-previous-symbolic",
3542+ "window", window,
3543+ "direction", EPHY_NAVIGATION_HISTORY_DIRECTION_BACK,
3544+ NULL);
3545+ gtk_action_group_add_action_with_accel (action_group, action,
3546+ "<alt>Left");
3547+ g_object_unref (action);
3548+
3549+ action =
3550+ g_object_new (EPHY_TYPE_NAVIGATION_HISTORY_ACTION,
3551+ "name", "NavigationForward",
3552+ "label", _("Forward"),
3553+ "icon-name", "go-next-symbolic",
3554+ "window", window,
3555+ "direction", EPHY_NAVIGATION_HISTORY_DIRECTION_FORWARD,
3556+ NULL);
3557+ gtk_action_group_add_action_with_accel (action_group, action,
3558+ "<alt>Right");
3559+ g_object_unref (action);
3560+
3561+ action =
3562+ g_object_new (EPHY_TYPE_ZOOM_ACTION,
3563+ "name", "Zoom",
3564+ "label", _("Zoom"),
3565+ "zoom", 1.0,
3566+ NULL);
3567+ gtk_action_group_add_action (action_group, action);
3568+ g_object_unref (action);
3569+
3570+ action = g_object_new (EPHY_TYPE_HOME_ACTION,
3571+ "name", "FileNewTab",
3572+ "icon-name", "tab-new-symbolic",
3573+ "label", _("New _Tab"),
3574+ NULL);
3575+ gtk_action_group_add_action_with_accel (action_group, action, "<control>T");
3576+ g_object_unref (action);
3577+
3578+ action =
3579+ g_object_new (EPHY_TYPE_HOME_ACTION,
3580+ "name", "FileHome",
3581+ "label", _("Go to most visited"),
3582+ NULL);
3583+ gtk_action_group_add_action_with_accel (action_group, action, "<alt>Home");
3584+ g_signal_connect_swapped (action, "open-link",
3585+ G_CALLBACK (ephy_link_open), window);
3586+ g_object_unref (action);
3587+
3588+ action = g_object_new (EPHY_TYPE_COMBINED_STOP_RELOAD_ACTION,
3589+ "name", "ViewCombinedStopReload",
3590+ "loading", FALSE,
3591+ "window", window,
3592+ NULL);
3593+ gtk_action_group_add_action (action_group, action);
3594+ g_object_unref (action);
3595+
3596+ gtk_action_group_set_accel_group (action_group, accel_group);
3597+ gtk_ui_manager_insert_action_group (manager, action_group, 0);
3598+ window->priv->toolbar_action_group = action_group;
3599+ g_object_unref (action_group);
3600+
3601+ window->priv->manager = manager;
3602+ gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
3603+}
3604+
3605+static char *
3606+calculate_location (const char *typed_address, const char *address)
3607+{
3608+ const char *location;
3609+
3610+ /* If there's a typed address, use that over address. Never
3611+ * show URIs in the 'do_not_show_address' array. */
3612+ location = typed_address ? typed_address : address;
3613+ location = ephy_embed_utils_is_no_show_address (location) ? NULL : location;
3614+
3615+ return g_strdup (location);
3616+}
3617+
3618+static void
3619+_ephy_window_set_default_actions_sensitive (EphyWindow *window,
3620+ guint flags,
3621+ gboolean set)
3622+{
3623+ EphyWindowPrivate *priv = window->priv;
3624+ GtkActionGroup *action_group;
3625+ GtkAction *action;
3626+ int i;
3627+ const char *action_group_actions[] = { "FileSaveAs", "FileSaveAsApplication", "FilePrint",
3628+ "FileSendTo", "FileBookmarkPage", "EditFind",
3629+ "EditFindPrev", "EditFindNext", "ViewEncoding",
3630+ "ViewZoomIn", "ViewZoomOut", "ViewPageSource",
3631+ NULL };
3632+
3633+ action_group = priv->action_group;
3634+
3635+ /* Page menu */
3636+ for (i = 0; action_group_actions[i] != NULL; i++)
3637+ {
3638+ action = gtk_action_group_get_action (action_group,
3639+ action_group_actions[i]);
3640+ ephy_action_change_sensitivity_flags (action,
3641+ flags, set);
3642+ }
3643+
3644+ /* Page context popup */
3645+ action = gtk_action_group_get_action (priv->popups_action_group,
3646+ "ContextBookmarkPage");
3647+ ephy_action_change_sensitivity_flags (action,
3648+ flags, set);
3649+
3650+ /* Toolbar */
3651+ action = gtk_action_group_get_action (priv->toolbar_action_group,
3652+ "ViewCombinedStopReload");
3653+ ephy_action_change_sensitivity_flags (action,
3654+ flags, set);
3655+}
3656+
3657+static void
3658+sync_tab_address (EphyWebView *view,
3659+ GParamSpec *pspec,
3660+ EphyWindow *window)
3661+{
3662+ EphyWindowPrivate *priv = window->priv;
3663+ const char *address;
3664+ const char *typed_address;
3665+ char *location;
3666+
3667+ if (priv->closing) return;
3668+
3669+ address = ephy_web_view_get_address (view);
3670+ typed_address = ephy_web_view_get_typed_address (view);
3671+
3672+ _ephy_window_set_default_actions_sensitive (window,
3673+ SENS_FLAG_IS_BLANK,
3674+ ephy_web_view_is_overview (view));
3675+
3676+ location = calculate_location (typed_address, address);
3677+ ephy_window_set_location (window, location);
3678+ g_free (location);
3679+}
3680+
3681+static void
3682+sync_tab_zoom (WebKitWebView *web_view, GParamSpec *pspec, EphyWindow *window)
3683+{
3684+ GtkActionGroup *action_group;
3685+ GtkAction *action;
3686+ gboolean can_zoom_in = TRUE, can_zoom_out = TRUE, can_zoom_normal = FALSE;
3687+ double zoom;
3688+
3689+ if (window->priv->closing) return;
3690+
3691+ zoom = webkit_web_view_get_zoom_level (web_view);
3692+
3693+ if (zoom >= ZOOM_MAXIMAL)
3694+ {
3695+ can_zoom_in = FALSE;
3696+ }
3697+
3698+ if (zoom <= ZOOM_MINIMAL)
3699+ {
3700+ can_zoom_out = FALSE;
3701+ }
3702+
3703+ if (zoom != 1.0)
3704+ {
3705+ can_zoom_normal = TRUE;
3706+ }
3707+
3708+ action_group = window->priv->action_group;
3709+ action = gtk_action_group_get_action (action_group, "ViewZoomIn");
3710+ gtk_action_set_sensitive (action, can_zoom_in);
3711+ action = gtk_action_group_get_action (action_group, "ViewZoomOut");
3712+ gtk_action_set_sensitive (action, can_zoom_out);
3713+ action = gtk_action_group_get_action (action_group, "ViewZoomNormal");
3714+ gtk_action_set_sensitive (action, can_zoom_normal);
3715+}
3716+
3717+static void
3718+sync_tab_document_type (EphyWebView *view,
3719+ GParamSpec *pspec,
3720+ EphyWindow *window)
3721+{
3722+ EphyWindowPrivate *priv = window->priv;
3723+ GtkActionGroup *action_group = priv->action_group;
3724+ GtkAction *action;
3725+ EphyWebViewDocumentType type;
3726+ gboolean can_find, disable, is_image;
3727+
3728+ if (priv->closing) return;
3729+
3730+ /* update zoom actions */
3731+ sync_tab_zoom (WEBKIT_WEB_VIEW (view), NULL, window);
3732+
3733+ type = ephy_web_view_get_document_type (view);
3734+ can_find = (type != EPHY_WEB_VIEW_DOCUMENT_IMAGE);
3735+ is_image = type == EPHY_WEB_VIEW_DOCUMENT_IMAGE;
3736+ disable = (type != EPHY_WEB_VIEW_DOCUMENT_HTML);
3737+
3738+ action = gtk_action_group_get_action (action_group, "ViewEncoding");
3739+ ephy_action_change_sensitivity_flags (action, SENS_FLAG_DOCUMENT, disable);
3740+ action = gtk_action_group_get_action (action_group, "ViewPageSource");
3741+ ephy_action_change_sensitivity_flags (action, SENS_FLAG_DOCUMENT, is_image);
3742+ action = gtk_action_group_get_action (action_group, "EditFind");
3743+ ephy_action_change_sensitivity_flags (action, SENS_FLAG_DOCUMENT, !can_find);
3744+ action = gtk_action_group_get_action (action_group, "EditFindNext");
3745+ ephy_action_change_sensitivity_flags (action, SENS_FLAG_DOCUMENT, !can_find);
3746+ action = gtk_action_group_get_action (action_group, "EditFindPrev");
3747+ ephy_action_change_sensitivity_flags (action, SENS_FLAG_DOCUMENT, !can_find);
3748+
3749+ if (!can_find)
3750+ {
3751+ ephy_find_toolbar_request_close (ephy_embed_get_find_toolbar (priv->active_embed));
3752+ }
3753+}
3754+
3755+static void
3756+_ephy_window_action_set_favicon (EphyWindow *window,
3757+ GdkPixbuf *icon)
3758+{
3759+ EphyWindowPrivate *priv = window->priv;
3760+
3761+ g_object_set (priv->location_controller, "icon", icon, NULL);
3762+}
3763+
3764+static void
3765+sync_tab_icon (EphyWebView *view,
3766+ GParamSpec *pspec,
3767+ EphyWindow *window)
3768+{
3769+ EphyWindowPrivate *priv = window->priv;
3770+ GdkPixbuf *icon;
3771+
3772+ if (priv->closing) return;
3773+
3774+ icon = ephy_web_view_get_icon (view);
3775+
3776+ _ephy_window_action_set_favicon (window, icon);
3777+}
3778+
3779+static void
3780+_ephy_window_set_navigation_flags (EphyWindow *window,
3781+ EphyWebViewNavigationFlags flags)
3782+{
3783+ GtkAction *action;
3784+
3785+ action = gtk_action_group_get_action (window->priv->toolbar_action_group, "NavigationBack");
3786+ gtk_action_set_sensitive (action, flags & EPHY_WEB_VIEW_NAV_BACK);
3787+ action = gtk_action_group_get_action (window->priv->toolbar_action_group, "NavigationForward");
3788+ gtk_action_set_sensitive (action, flags & EPHY_WEB_VIEW_NAV_FORWARD);
3789+}
3790+
3791+static void
3792+sync_tab_navigation (EphyWebView *view,
3793+ GParamSpec *pspec,
3794+ EphyWindow *window)
3795+{
3796+ if (window->priv->closing) return;
3797+
3798+ _ephy_window_set_navigation_flags (window,
3799+ ephy_web_view_get_navigation_flags (view));
3800+}
3801+
3802+static void
3803+sync_tab_is_blank (EphyWebView *view,
3804+ GParamSpec *pspec,
3805+ EphyWindow *window)
3806+{
3807+ if (window->priv->closing) return;
3808+
3809+ _ephy_window_set_default_actions_sensitive (window,
3810+ SENS_FLAG_IS_BLANK,
3811+ ephy_web_view_get_is_blank (view));
3812+}
3813+
3814+static void
3815+sync_tab_popup_windows (EphyWebView *view,
3816+ GParamSpec *pspec,
3817+ EphyWindow *window)
3818+{
3819+ /* FIXME: show popup count somehow */
3820+}
3821+
3822+static void
3823+sync_tab_popups_allowed (EphyWebView *view,
3824+ GParamSpec *pspec,
3825+ EphyWindow *window)
3826+{
3827+ GtkAction *action;
3828+ gboolean allow;
3829+
3830+ g_return_if_fail (EPHY_IS_WEB_VIEW (view));
3831+ g_return_if_fail (EPHY_IS_WINDOW (window));
3832+
3833+ action = gtk_action_group_get_action (window->priv->action_group,
3834+ "ViewPopupWindows");
3835+ g_return_if_fail (GTK_IS_ACTION (action));
3836+
3837+ g_object_get (view, "popups-allowed", &allow, NULL);
3838+
3839+ g_signal_handlers_block_by_func
3840+ (G_OBJECT (action),
3841+ G_CALLBACK (ephy_window_view_popup_windows_cb),
3842+ window);
3843+
3844+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), allow);
3845+
3846+ g_signal_handlers_unblock_by_func
3847+ (G_OBJECT (action),
3848+ G_CALLBACK (ephy_window_view_popup_windows_cb),
3849+ window);
3850+}
3851+
3852+static void
3853+sync_tab_title (EphyEmbed *embed,
3854+ GParamSpec *pspec,
3855+ EphyWindow *window)
3856+{
3857+ EphyWindowPrivate *priv = window->priv;
3858+
3859+ if (priv->closing) return;
3860+
3861+ gtk_window_set_title (GTK_WINDOW(window),
3862+ ephy_embed_get_title (embed));
3863+}
3864+
3865+static gboolean
3866+idle_unref_context_event (EphyWindow *window)
3867+{
3868+ EphyWindowPrivate *priv = window->priv;
3869+
3870+ LOG ("Idle unreffing context event %p", priv->context_event);
3871+
3872+ if (priv->context_event != NULL)
3873+ {
3874+ g_object_unref (priv->context_event);
3875+ priv->context_event = NULL;
3876+ }
3877+
3878+ priv->idle_worker = 0;
3879+ return FALSE;
3880+}
3881+
3882+static void
3883+_ephy_window_set_context_event (EphyWindow *window,
3884+ EphyEmbedEvent *event)
3885+{
3886+ EphyWindowPrivate *priv = window->priv;
3887+
3888+ if (priv->idle_worker != 0)
3889+ {
3890+ g_source_remove (priv->idle_worker);
3891+ priv->idle_worker = 0;
3892+ }
3893+
3894+ if (priv->context_event != NULL)
3895+ {
3896+ g_object_unref (priv->context_event);
3897+ }
3898+
3899+ priv->context_event = event != NULL ? g_object_ref (event) : NULL;
3900+}
3901+
3902+static void
3903+_ephy_window_unset_context_event (EphyWindow *window)
3904+{
3905+ EphyWindowPrivate *priv = window->priv;
3906+
3907+ /* Unref the event from idle since we still need it
3908+ * from the action callbacks which will run before idle.
3909+ */
3910+ if (priv->idle_worker == 0 && priv->context_event != NULL)
3911+ {
3912+ priv->idle_worker =
3913+ g_idle_add ((GSourceFunc) idle_unref_context_event, window);
3914+ }
3915+}
3916+
3917+static void
3918+context_menu_dismissed_cb (WebKitWebView *webView,
3919+ EphyWindow *window)
3920+{
3921+ LOG ("Deactivating popup menu");
3922+
3923+ enable_edit_actions_sensitivity (window);
3924+
3925+ g_signal_handlers_disconnect_by_func
3926+ (webView, G_CALLBACK (context_menu_dismissed_cb), window);
3927+
3928+ _ephy_window_unset_context_event (window);
3929+}
3930+
3931+static void
3932+add_action_to_context_menu (WebKitContextMenu *context_menu,
3933+ GtkActionGroup *action_group,
3934+ const char *action_name)
3935+{
3936+ GtkAction *action;
3937+
3938+ action = gtk_action_group_get_action (action_group, action_name);
3939+ webkit_context_menu_append (context_menu, webkit_context_menu_item_new (action));
3940+}
3941+
3942+static void
3943+add_item_to_context_menu (WebKitContextMenu *context_menu,
3944+ WebKitContextMenuItem *item)
3945+{
3946+ if (!item)
3947+ return;
3948+
3949+ webkit_context_menu_append (context_menu, item);
3950+ g_object_unref (item);
3951+}
3952+
3953+/* FIXME: Add webkit_context_menu_find() ? */
3954+static WebKitContextMenuItem *
3955+find_item_in_context_menu (WebKitContextMenu *context_menu,
3956+ WebKitContextMenuAction action)
3957+{
3958+ GList *items, *iter;
3959+
3960+ items = webkit_context_menu_get_items (context_menu);
3961+ for (iter = items; iter; iter = g_list_next (iter))
3962+ {
3963+ WebKitContextMenuItem *item = (WebKitContextMenuItem *)iter->data;
3964+
3965+ if (webkit_context_menu_item_get_stock_action (item) == action)
3966+ return g_object_ref (item);
3967+ }
3968+
3969+ return NULL;
3970+}
3971+
3972+static GList *
3973+find_spelling_guess_context_menu_items (WebKitContextMenu *context_menu)
3974+{
3975+ GList *items, *iter;
3976+ guint i;
3977+ GList *retval = NULL;
3978+
3979+ items = webkit_context_menu_get_items (context_menu);
3980+ for (iter = items, i = 0; iter && i < MAX_SPELL_CHECK_GUESSES; iter = g_list_next (iter), i++)
3981+ {
3982+ WebKitContextMenuItem *item = (WebKitContextMenuItem *)iter->data;
3983+
3984+ if (webkit_context_menu_item_get_stock_action (item) == WEBKIT_CONTEXT_MENU_ACTION_SPELLING_GUESS)
3985+ {
3986+ retval = g_list_prepend (retval, g_object_ref (item));
3987+ }
3988+ else
3989+ {
3990+ /* Spelling guesses are always at the beginning of the context menu, so
3991+ * we can break the loop as soon as we find the first item that is not
3992+ * spelling guess.
3993+ */
3994+ break;
3995+ }
3996+ }
3997+
3998+ return g_list_reverse (retval);
3999+}
4000+
4001+static gboolean
4002+populate_context_menu (WebKitWebView *web_view,
4003+ WebKitContextMenu *context_menu,
4004+ GdkEvent *event,
4005+ WebKitHitTestResult *hit_test_result,
4006+ EphyWindow *window)
4007+{
4008+ EphyWindowPrivate *priv = window->priv;
4009+ WebKitContextMenuItem *input_methods_item = NULL;
4010+ WebKitContextMenuItem *unicode_item = NULL;
4011+ WebKitContextMenuItem *play_pause_item = NULL;
4012+ WebKitContextMenuItem *mute_item = NULL;
4013+ WebKitContextMenuItem *toggle_controls_item = NULL;
4014+ WebKitContextMenuItem *toggle_loop_item = NULL;
4015+ WebKitContextMenuItem *fullscreen_item = NULL;
4016+ GList *spelling_guess_items = NULL;
4017+ EphyEmbedEvent *embed_event;
4018+ gboolean is_document = FALSE;
4019+ gboolean app_mode;
4020+ gboolean is_image;
4021+ gboolean is_media = FALSE;
4022+ gboolean is_video = FALSE;
4023+ gboolean is_audio = FALSE;
4024+
4025+ is_image = webkit_hit_test_result_context_is_image (hit_test_result);
4026+
4027+ if (webkit_hit_test_result_context_is_editable (hit_test_result)) {
4028+ input_methods_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_INPUT_METHODS);
4029+ unicode_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_UNICODE);
4030+ spelling_guess_items = find_spelling_guess_context_menu_items (context_menu);
4031+ }
4032+
4033+ if (webkit_hit_test_result_context_is_media (hit_test_result))
4034+ {
4035+ WebKitContextMenuItem *item;
4036+
4037+ is_media = TRUE;
4038+ play_pause_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PLAY);
4039+ if (!play_pause_item)
4040+ play_pause_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PAUSE);
4041+ mute_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_MEDIA_MUTE);
4042+ toggle_controls_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_TOGGLE_MEDIA_CONTROLS);
4043+ toggle_loop_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_TOGGLE_MEDIA_LOOP);
4044+ fullscreen_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_ENTER_VIDEO_FULLSCREEN);
4045+
4046+ item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_COPY_VIDEO_LINK_TO_CLIPBOARD);
4047+ if (item)
4048+ {
4049+ is_video = TRUE;
4050+ g_object_unref (item);
4051+ }
4052+ else
4053+ {
4054+ item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_COPY_AUDIO_LINK_TO_CLIPBOARD);
4055+ if (item)
4056+ {
4057+ is_audio = TRUE;
4058+ g_object_unref (item);
4059+ }
4060+ }
4061+ }
4062+
4063+ webkit_context_menu_remove_all (context_menu);
4064+
4065+ embed_event = ephy_embed_event_new ((GdkEventButton *)event, hit_test_result);
4066+ _ephy_window_set_context_event (window, embed_event);
4067+ g_object_unref (embed_event);
4068+
4069+ app_mode = ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) == EPHY_EMBED_SHELL_MODE_APPLICATION;
4070+
4071+ update_edit_actions_sensitivity (window, FALSE);
4072+
4073+ if (webkit_hit_test_result_context_is_link (hit_test_result))
4074+ {
4075+ const char *uri;
4076+ gboolean link_has_web_scheme;
4077+
4078+ uri = webkit_hit_test_result_get_link_uri (hit_test_result);
4079+ link_has_web_scheme = ephy_embed_utils_address_has_web_scheme (uri);
4080+
4081+ update_edit_actions_sensitivity (window, TRUE);
4082+ update_link_actions_sensitivity (window, link_has_web_scheme);
4083+
4084+ if (!app_mode)
4085+ {
4086+ add_action_to_context_menu (context_menu,
4087+ priv->popups_action_group, "OpenLinkInNewTab");
4088+ add_action_to_context_menu (context_menu,
4089+ priv->popups_action_group, "OpenLinkInNewWindow");
4090+ webkit_context_menu_append (context_menu,
4091+ webkit_context_menu_item_new_separator ());
4092+ }
4093+ add_action_to_context_menu (context_menu,
4094+ priv->action_group, "EditCopy");
4095+ webkit_context_menu_append (context_menu,
4096+ webkit_context_menu_item_new_separator ());
4097+ add_action_to_context_menu (context_menu,
4098+ priv->popups_action_group, "DownloadLinkAs");
4099+
4100+ if (g_str_has_prefix (uri, "mailto:"))
4101+ {
4102+ add_action_to_context_menu (context_menu,
4103+ priv->popups_action_group, "CopyEmailAddress");
4104+ }
4105+ else
4106+ {
4107+ add_action_to_context_menu (context_menu,
4108+ priv->popups_action_group, "CopyLinkAddress");
4109+ }
4110+ }
4111+ else if (webkit_hit_test_result_context_is_editable (hit_test_result))
4112+ {
4113+ GList *l;
4114+ gboolean has_guesses = FALSE;
4115+
4116+ for (l = spelling_guess_items; l; l = g_list_next (l))
4117+ {
4118+ WebKitContextMenuItem *item = WEBKIT_CONTEXT_MENU_ITEM (l->data);
4119+
4120+ webkit_context_menu_append (context_menu, item);
4121+ g_object_unref (item);
4122+ has_guesses = TRUE;
4123+ }
4124+ g_list_free (spelling_guess_items);
4125+
4126+ if (has_guesses)
4127+ {
4128+ webkit_context_menu_append (context_menu,
4129+ webkit_context_menu_item_new_separator ());
4130+ }
4131+
4132+ update_edit_actions_sensitivity (window, FALSE);
4133+
4134+ add_action_to_context_menu (context_menu,
4135+ priv->action_group, "EditUndo");
4136+ add_action_to_context_menu (context_menu,
4137+ priv->action_group, "EditRedo");
4138+ webkit_context_menu_append (context_menu,
4139+ webkit_context_menu_item_new_separator ());
4140+ add_action_to_context_menu (context_menu,
4141+ priv->action_group, "EditCut");
4142+ add_action_to_context_menu (context_menu,
4143+ priv->action_group, "EditCopy");
4144+ add_action_to_context_menu (context_menu,
4145+ priv->action_group, "EditPaste");
4146+ webkit_context_menu_append (context_menu,
4147+ webkit_context_menu_item_new_separator ());
4148+ add_action_to_context_menu (context_menu,
4149+ priv->action_group, "EditSelectAll");
4150+ if (input_methods_item || unicode_item)
4151+ webkit_context_menu_append (context_menu,
4152+ webkit_context_menu_item_new_separator ());
4153+ add_item_to_context_menu (context_menu, input_methods_item);
4154+ add_item_to_context_menu (context_menu, unicode_item);
4155+ }
4156+ else
4157+ {
4158+ is_document = TRUE;
4159+
4160+ update_edit_actions_sensitivity (window, TRUE);
4161+
4162+ if (!is_image && !is_media)
4163+ {
4164+ add_action_to_context_menu (context_menu,
4165+ priv->toolbar_action_group, "NavigationBack");
4166+ add_action_to_context_menu (context_menu,
4167+ priv->toolbar_action_group, "NavigationForward");
4168+ add_action_to_context_menu (context_menu,
4169+ priv->action_group, "ViewReload");
4170+ webkit_context_menu_append (context_menu,
4171+ webkit_context_menu_item_new_separator ());
4172+ }
4173+
4174+ add_action_to_context_menu (context_menu,
4175+ priv->action_group, "EditCopy");
4176+
4177+ if (!app_mode && !is_image && !is_media)
4178+ {
4179+ webkit_context_menu_append (context_menu,
4180+ webkit_context_menu_item_new_separator ());
4181+ add_action_to_context_menu (context_menu,
4182+ priv->popups_action_group, "ContextBookmarkPage");
4183+ }
4184+ }
4185+
4186+ if (is_image)
4187+ {
4188+ webkit_context_menu_append (context_menu,
4189+ webkit_context_menu_item_new_separator ());
4190+ add_action_to_context_menu (context_menu,
4191+ priv->popups_action_group, "SaveImageAs");
4192+ add_action_to_context_menu (context_menu,
4193+ priv->popups_action_group, "CopyImageLocation");
4194+ add_action_to_context_menu (context_menu,
4195+ priv->popups_action_group, "ViewImage");
4196+ add_action_to_context_menu (context_menu,
4197+ priv->popups_action_group, "SetImageAsBackground");
4198+ }
4199+
4200+ if (is_media)
4201+ {
4202+ add_item_to_context_menu (context_menu, play_pause_item);
4203+ add_item_to_context_menu (context_menu, mute_item);
4204+ add_item_to_context_menu (context_menu, toggle_controls_item);
4205+ add_item_to_context_menu (context_menu, toggle_loop_item);
4206+ add_item_to_context_menu (context_menu, fullscreen_item);
4207+ webkit_context_menu_append (context_menu,
4208+ webkit_context_menu_item_new_separator ());
4209+ if (is_video)
4210+ {
4211+ add_action_to_context_menu (context_menu, priv->popups_action_group,
4212+ "OpenVideoInNewWindow");
4213+ add_action_to_context_menu (context_menu, priv->popups_action_group,
4214+ "OpenVideoInNewTab");
4215+ add_action_to_context_menu (context_menu, priv->popups_action_group,
4216+ "SaveVideoAs");
4217+ add_action_to_context_menu (context_menu, priv->popups_action_group,
4218+ "CopyVideoLocation");
4219+ }
4220+ else if (is_audio)
4221+ {
4222+ add_action_to_context_menu (context_menu, priv->popups_action_group,
4223+ "OpenAudioInNewWindow");
4224+ add_action_to_context_menu (context_menu, priv->popups_action_group,
4225+ "OpenAudioInNewTab");
4226+ add_action_to_context_menu (context_menu, priv->popups_action_group,
4227+ "SaveAudioAs");
4228+ add_action_to_context_menu (context_menu, priv->popups_action_group,
4229+ "CopyAudioLocation");
4230+ }
4231+ }
4232+
4233+ g_signal_connect (web_view, "context-menu-dismissed",
4234+ G_CALLBACK (context_menu_dismissed_cb),
4235+ window);
4236+
4237+ if (app_mode)
4238+ return FALSE;
4239+
4240+ if (is_document && !is_image && !is_media)
4241+ {
4242+ webkit_context_menu_append (context_menu,
4243+ webkit_context_menu_item_new_separator ());
4244+ add_action_to_context_menu (context_menu,
4245+ priv->action_group, "FileSendTo");
4246+ }
4247+
4248+ webkit_context_menu_append (context_menu,
4249+ webkit_context_menu_item_new_separator ());
4250+ webkit_context_menu_append (context_menu,
4251+ webkit_context_menu_item_new_from_stock_action (WEBKIT_CONTEXT_MENU_ACTION_INSPECT_ELEMENT));
4252+
4253+ return FALSE;
4254+}
4255+
4256+static gboolean
4257+save_target_uri (EphyWindow *window,
4258+ WebKitWebView *view,
4259+ GdkEventButton *event,
4260+ WebKitHitTestResult *hit_test_result)
4261+{
4262+ guint context;
4263+ char *location = NULL;
4264+ gboolean retval = FALSE;
4265+
4266+ g_object_get (hit_test_result, "context", &context, NULL);
4267+
4268+ LOG ("ephy_window_dom_mouse_click_cb: button %d, context %d, modifier %d (%d:%d)",
4269+ event->button, context, event->state, (int)event->x, (int)event->y);
4270+
4271+ /* shift+click saves the link target */
4272+ if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK)
4273+ {
4274+ g_object_get (G_OBJECT (hit_test_result), "link-uri", &location, NULL);
4275+ }
4276+ /* Note: pressing enter to submit a form synthesizes a mouse
4277+ * click event
4278+ */
4279+ /* shift+click saves the non-link image */
4280+ else if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE &&
4281+ !(context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE))
4282+ {
4283+ g_object_get (G_OBJECT (hit_test_result), "image-uri", &location, NULL);
4284+ }
4285+
4286+ if (location)
4287+ {
4288+ LOG ("Location: %s", location);
4289+
4290+ retval = ephy_embed_utils_address_has_web_scheme (location);
4291+ if (retval)
4292+ {
4293+ EphyDownload *download;
4294+
4295+ download = ephy_download_new_for_uri (location, GTK_WINDOW (window));
4296+ ephy_download_set_action (download, EPHY_DOWNLOAD_ACTION_OPEN);
4297+ ephy_window_add_download (window, download);
4298+ g_object_unref (download);
4299+ }
4300+
4301+ g_free (location);
4302+ }
4303+
4304+ return retval;
4305+}
4306+
4307+static gboolean
4308+ephy_window_dom_mouse_click_cb (WebKitWebView *view,
4309+ GdkEventButton *event,
4310+ EphyWindow *window)
4311+{
4312+ WebKitHitTestResult *hit_test_result;
4313+ gboolean handled = FALSE;
4314+
4315+ /* Since we're only dealing with shift+click, we can do these
4316+ checks early. */
4317+ if (!(event->state & GDK_SHIFT_MASK) || event->button != GDK_BUTTON_PRIMARY)
4318+ {
4319+ return FALSE;
4320+ }
4321+
4322+ hit_test_result = g_object_ref (window->priv->hit_test_result);
4323+ handled = save_target_uri (window, view, event, hit_test_result);
4324+ g_object_unref (hit_test_result);
4325+
4326+ return handled;
4327+}
4328+
4329+static void
4330+ephy_window_mouse_target_changed_cb (WebKitWebView *web_view,
4331+ WebKitHitTestResult *hit_test_result,
4332+ guint modifiers,
4333+ EphyWindow *window)
4334+{
4335+ EphyWindowPrivate *priv = window->priv;
4336+
4337+ if (priv->hit_test_result)
4338+ g_object_unref (priv->hit_test_result);
4339+ priv->hit_test_result = g_object_ref (hit_test_result);
4340+}
4341+
4342+static void
4343+ephy_window_set_is_popup (EphyWindow *window,
4344+ gboolean is_popup)
4345+{
4346+ EphyWindowPrivate *priv = window->priv;
4347+
4348+ priv->is_popup = is_popup;
4349+
4350+ g_object_notify (G_OBJECT (window), "is-popup");
4351+}
4352+
4353+static void
4354+window_properties_geometry_changed (WebKitWindowProperties *properties,
4355+ GParamSpec *pspec,
4356+ EphyWindow *window)
4357+{
4358+ GdkRectangle geometry;
4359+
4360+ webkit_window_properties_get_geometry (properties, &geometry);
4361+ if (geometry.x >= 0 && geometry.y >= 0)
4362+ gtk_window_move (GTK_WINDOW (window), geometry.x, geometry.y);
4363+ if (geometry.width > 0 && geometry.height > 0)
4364+ gtk_window_resize (GTK_WINDOW (window), geometry.width, geometry.height);
4365+}
4366+
4367+static void
4368+ephy_window_configure_for_view (EphyWindow *window,
4369+ WebKitWebView *web_view)
4370+{
4371+ WebKitWindowProperties *properties;
4372+ GdkRectangle geometry;
4373+ EphyWindowChrome chrome = 0;
4374+
4375+ properties = webkit_web_view_get_window_properties (web_view);
4376+
4377+ if (webkit_window_properties_get_toolbar_visible (properties))
4378+ chrome |= EPHY_WINDOW_CHROME_TOOLBAR;
4379+
4380+ if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != EPHY_EMBED_SHELL_MODE_APPLICATION)
4381+ {
4382+ GtkWidget *entry;
4383+
4384+ entry = ephy_toolbar_get_location_entry (EPHY_TOOLBAR (window->priv->toolbar));
4385+ gtk_editable_set_editable (GTK_EDITABLE (entry), FALSE);
4386+
4387+ if (webkit_window_properties_get_menubar_visible (properties))
4388+ chrome |= EPHY_WINDOW_CHROME_MENU;
4389+ if (webkit_window_properties_get_locationbar_visible (properties))
4390+ chrome |= EPHY_WINDOW_CHROME_LOCATION;
4391+ }
4392+
4393+ webkit_window_properties_get_geometry (properties, &geometry);
4394+ if (geometry.width > 0 && geometry.height > 0)
4395+ gtk_window_set_default_size (GTK_WINDOW (window), geometry.width, geometry.height);
4396+
4397+ if (!webkit_window_properties_get_resizable (properties))
4398+ gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
4399+
4400+ window->priv->is_popup = TRUE;
4401+ ephy_window_set_chrome (window, chrome);
4402+ g_signal_connect (properties, "notify::geometry",
4403+ G_CALLBACK (window_properties_geometry_changed),
4404+ window);
4405+}
4406+
4407+static gboolean
4408+web_view_ready_cb (WebKitWebView *web_view,
4409+ WebKitWebView *parent_web_view)
4410+{
4411+ EphyWindow *window, *parent_view_window;
4412+ gboolean using_new_window;
4413+
4414+ window = EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (web_view)));
4415+ parent_view_window = EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (parent_web_view)));
4416+
4417+ using_new_window = window != parent_view_window;
4418+
4419+ if (using_new_window)
4420+ {
4421+ ephy_window_configure_for_view (window, web_view);
4422+ g_signal_emit_by_name (parent_web_view, "new-window", web_view);
4423+ }
4424+
4425+ if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) == EPHY_EMBED_SHELL_MODE_APPLICATION &&
4426+ !webkit_web_view_get_uri(web_view))
4427+ {
4428+ /* Wait until we have a valid URL to decide whether to show the window
4429+ * or load the URL in the default web browser
4430+ */
4431+ g_object_set_data_full (G_OBJECT (window), "referrer",
4432+ g_strdup (webkit_web_view_get_uri (parent_web_view)),
4433+ g_free);
4434+ return TRUE;
4435+ }
4436+
4437+ gtk_widget_show (GTK_WIDGET (window));
4438+
4439+ return TRUE;
4440+}
4441+
4442+static WebKitWebView *
4443+create_web_view_cb (WebKitWebView *web_view,
4444+ WebKitNavigationAction *navigation_action,
4445+ EphyWindow *window)
4446+{
4447+ EphyEmbed *embed;
4448+ WebKitWebView *new_web_view;
4449+ EphyNewTabFlags flags;
4450+ EphyWindow *target_window;
4451+
4452+ if ((ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != EPHY_EMBED_SHELL_MODE_APPLICATION) &&
4453+ (g_settings_get_boolean (EPHY_SETTINGS_MAIN,
4454+ EPHY_PREFS_NEW_WINDOWS_IN_TABS) ||
4455+ g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN,
4456+ EPHY_PREFS_LOCKDOWN_FULLSCREEN)))
4457+ {
4458+ target_window = window;
4459+ flags = EPHY_NEW_TAB_JUMP |
4460+ EPHY_NEW_TAB_APPEND_AFTER;
4461+ }
4462+ else
4463+ {
4464+ target_window = ephy_window_new ();
4465+ flags = EPHY_NEW_TAB_DONT_SHOW_WINDOW;
4466+ }
4467+
4468+ embed = ephy_shell_new_tab_full (ephy_shell_get_default (),
4469+ NULL,
4470+ web_view,
4471+ target_window,
4472+ EPHY_GET_EMBED_FROM_EPHY_WEB_VIEW (web_view),
4473+ flags,
4474+ 0);
4475+ if (target_window == window)
4476+ gtk_widget_grab_focus (GTK_WIDGET (embed));
4477+
4478+ new_web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
4479+ g_signal_connect (new_web_view, "ready-to-show",
4480+ G_CALLBACK (web_view_ready_cb),
4481+ web_view);
4482+
4483+ return new_web_view;
4484+}
4485+
4486+static gboolean
4487+decide_policy_cb (WebKitWebView *web_view,
4488+ WebKitPolicyDecision *decision,
4489+ WebKitPolicyDecisionType decision_type,
4490+ EphyWindow *window)
4491+{
4492+ WebKitNavigationPolicyDecision *navigation_decision;
4493+ WebKitNavigationAction *navigation_action;
4494+ WebKitNavigationType navigation_type;
4495+ WebKitURIRequest *request;
4496+ const char *uri;
4497+ EphyEmbed *embed;
4498+
4499+ if (decision_type == WEBKIT_POLICY_DECISION_TYPE_RESPONSE)
4500+ return FALSE;
4501+
4502+ navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision);
4503+ navigation_action = webkit_navigation_policy_decision_get_navigation_action (navigation_decision);
4504+ request = webkit_navigation_action_get_request (navigation_action);
4505+ uri = webkit_uri_request_get_uri (request);
4506+
4507+ if (!ephy_embed_utils_address_has_web_scheme (uri))
4508+ {
4509+ GError *error = NULL;
4510+ GdkScreen *screen;
4511+
4512+ screen = gtk_widget_get_screen (GTK_WIDGET (web_view));
4513+ gtk_show_uri (screen, uri, GDK_CURRENT_TIME, &error);
4514+
4515+ if (error)
4516+ {
4517+ LOG ("failed to handle non web scheme: %s", error->message);
4518+ g_error_free (error);
4519+
4520+ return FALSE;
4521+ }
4522+
4523+ webkit_policy_decision_ignore (decision);
4524+
4525+ return TRUE;
4526+ }
4527+
4528+ if (decision_type == WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION)
4529+ {
4530+ const char *frame_name = webkit_navigation_policy_decision_get_frame_name (navigation_decision);
4531+
4532+ if (g_strcmp0 (frame_name, "_evince_download") == 0)
4533+ {
4534+ /* The Evince Browser Plugin is requesting us to downlod the document */
4535+ webkit_policy_decision_download (decision);
4536+ return TRUE;
4537+ }
4538+
4539+ if (!g_settings_get_boolean (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_ENABLE_POPUPS) &&
4540+ !webkit_navigation_action_is_user_gesture (navigation_action))
4541+ {
4542+ webkit_policy_decision_ignore (decision);
4543+ return TRUE;
4544+ }
4545+ }
4546+
4547+ navigation_type = webkit_navigation_action_get_navigation_type (navigation_action);
4548+
4549+ if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) == EPHY_EMBED_SHELL_MODE_APPLICATION)
4550+ {
4551+ if (!gtk_widget_is_visible (GTK_WIDGET (window)))
4552+ {
4553+ char *referrer;
4554+
4555+ referrer = (char *)g_object_get_data (G_OBJECT (window), "referrer");
4556+
4557+ if (ephy_embed_utils_urls_have_same_origin (uri, referrer))
4558+ {
4559+ gtk_widget_show (GTK_WIDGET (window));
4560+ }
4561+ else
4562+ {
4563+ ephy_file_open_uri_in_default_browser (uri, GDK_CURRENT_TIME,
4564+ gtk_window_get_screen (GTK_WINDOW (window)));
4565+ webkit_policy_decision_ignore (decision);
4566+
4567+ gtk_widget_destroy (GTK_WIDGET (window));
4568+
4569+ return TRUE;
4570+ }
4571+ }
4572+
4573+ if (navigation_type == WEBKIT_NAVIGATION_TYPE_LINK_CLICKED)
4574+ {
4575+ if (ephy_embed_utils_urls_have_same_origin (uri, webkit_web_view_get_uri (web_view)))
4576+ {
4577+ return FALSE;
4578+ }
4579+
4580+ ephy_file_open_uri_in_default_browser (uri, GDK_CURRENT_TIME,
4581+ gtk_window_get_screen (GTK_WINDOW (window)));
4582+ webkit_policy_decision_ignore (decision);
4583+
4584+ return TRUE;
4585+ }
4586+ }
4587+
4588+ if (navigation_type == WEBKIT_NAVIGATION_TYPE_LINK_CLICKED)
4589+ {
4590+ gint button;
4591+ gint state;
4592+ EphyEmbed *new_embed;
4593+ EphyNewTabFlags flags = 0;
4594+ EphyWindow *target_window = window;
4595+
4596+ button = webkit_navigation_action_get_mouse_button (navigation_action);
4597+ state = webkit_navigation_action_get_modifiers (navigation_action);
4598+
4599+ ephy_web_view_set_visit_type (EPHY_WEB_VIEW (web_view),
4600+ EPHY_PAGE_VISIT_LINK);
4601+
4602+ /* New tab in new window for control+shift+click */
4603+ if (button == 1 && state == (GDK_SHIFT_MASK | GDK_CONTROL_MASK) &&
4604+ !g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN,
4605+ EPHY_PREFS_LOCKDOWN_FULLSCREEN))
4606+ {
4607+ target_window = ephy_window_new ();
4608+ }
4609+ /* New tab in existing window for middle click and
4610+ * control+click */
4611+ else if (button == 2 || (button == 1 && state == GDK_CONTROL_MASK))
4612+ {
4613+ flags |= EPHY_NEW_TAB_APPEND_AFTER;
4614+ }
4615+ /* Because we connect to button-press-event *after*
4616+ * (G_CONNECT_AFTER) we need to prevent WebKit from browsing to
4617+ * a link when you shift+click it. Otherwise when you
4618+ * shift+click a link to download it you would also be taken to
4619+ * the link destination. */
4620+ else if (button == 1 && state == GDK_SHIFT_MASK)
4621+ {
4622+ webkit_policy_decision_ignore (decision);
4623+
4624+ return TRUE;
4625+ }
4626+ /* Those were our special cases, we won't handle this */
4627+ else
4628+ {
4629+ return FALSE;
4630+ }
4631+
4632+ embed = ephy_embed_container_get_active_child
4633+ (EPHY_EMBED_CONTAINER (window));
4634+
4635+ new_embed = ephy_shell_new_tab_full (ephy_shell_get_default (),
4636+ NULL, NULL,
4637+ target_window,
4638+ embed,
4639+ flags,
4640+ 0);
4641+ ephy_web_view_load_request (ephy_embed_get_web_view (new_embed), request);
4642+
4643+ webkit_policy_decision_ignore (decision);
4644+
4645+ return TRUE;
4646+ }
4647+
4648+ return FALSE;
4649+}
4650+
4651+static void
4652+ephy_window_connect_active_embed (EphyWindow *window)
4653+{
4654+ EphyEmbed *embed;
4655+ WebKitWebView *web_view;
4656+ EphyWebView *view;
4657+
4658+ g_return_if_fail (window->priv->active_embed != NULL);
4659+
4660+ embed = window->priv->active_embed;
4661+ view = ephy_embed_get_web_view (embed);
4662+ web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
4663+
4664+ sync_tab_security (view, NULL, window);
4665+ sync_tab_document_type (view, NULL, window);
4666+ sync_tab_load_status (view, WEBKIT_LOAD_STARTED, window);
4667+ sync_tab_is_blank (view, NULL, window);
4668+ sync_tab_navigation (view, NULL, window);
4669+ sync_tab_title (embed, NULL, window);
4670+ sync_tab_address (view, NULL, window);
4671+ sync_tab_icon (view, NULL, window);
4672+ sync_tab_popup_windows (view, NULL, window);
4673+ sync_tab_popups_allowed (view, NULL, window);
4674+
4675+ sync_tab_zoom (web_view, NULL, window);
4676+
4677+ g_signal_connect_object (web_view, "notify::zoom-level",
4678+ G_CALLBACK (sync_tab_zoom),
4679+ window, 0);
4680+
4681+ g_signal_connect_object (web_view, "create",
4682+ G_CALLBACK (create_web_view_cb),
4683+ window, 0);
4684+ g_signal_connect_object (web_view, "decide-policy",
4685+ G_CALLBACK (decide_policy_cb),
4686+ window, 0);
4687+ g_signal_connect_object (view, "notify::hidden-popup-count",
4688+ G_CALLBACK (sync_tab_popup_windows),
4689+ window, 0);
4690+ g_signal_connect_object (view, "notify::popups-allowed",
4691+ G_CALLBACK (sync_tab_popups_allowed),
4692+ window, 0);
4693+ g_signal_connect_object (embed, "notify::title",
4694+ G_CALLBACK (sync_tab_title),
4695+ window, 0);
4696+ g_signal_connect_object (view, "notify::address",
4697+ G_CALLBACK (sync_tab_address),
4698+ window, 0);
4699+ g_signal_connect_object (view, "notify::icon",
4700+ G_CALLBACK (sync_tab_icon),
4701+ window, 0);
4702+ g_signal_connect_object (view, "notify::security-level",
4703+ G_CALLBACK (sync_tab_security),
4704+ window, 0);
4705+ g_signal_connect_object (view, "notify::document-type",
4706+ G_CALLBACK (sync_tab_document_type),
4707+ window, 0);
4708+ g_signal_connect_object (view, "load-changed",
4709+ G_CALLBACK (sync_tab_load_status),
4710+ window, 0);
4711+ g_signal_connect_object (view, "notify::navigation",
4712+ G_CALLBACK (sync_tab_navigation),
4713+ window, 0);
4714+ g_signal_connect_object (view, "notify::is-blank",
4715+ G_CALLBACK (sync_tab_is_blank),
4716+ window, 0);
4717+ g_signal_connect_object (view, "button-press-event",
4718+ G_CALLBACK (ephy_window_dom_mouse_click_cb),
4719+ window, 0);
4720+ g_signal_connect_object (view, "context-menu",
4721+ G_CALLBACK (populate_context_menu),
4722+ window, 0);
4723+ g_signal_connect_object (view, "mouse-target-changed",
4724+ G_CALLBACK (ephy_window_mouse_target_changed_cb),
4725+ window, 0);
4726+
4727+ g_object_notify (G_OBJECT (window), "active-child");
4728+}
4729+
4730+static void
4731+ephy_window_disconnect_active_embed (EphyWindow *window)
4732+{
4733+ EphyEmbed *embed;
4734+ WebKitWebView *web_view;
4735+ EphyWebView *view;
4736+
4737+ g_return_if_fail (window->priv->active_embed != NULL);
4738+
4739+ embed = window->priv->active_embed;
4740+ web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
4741+ view = EPHY_WEB_VIEW (web_view);
4742+
4743+ g_signal_handlers_disconnect_by_func (web_view,
4744+ G_CALLBACK (sync_tab_zoom),
4745+ window);
4746+ g_signal_handlers_disconnect_by_func (web_view,
4747+ G_CALLBACK (create_web_view_cb),
4748+ window);
4749+ g_signal_handlers_disconnect_by_func (view,
4750+ G_CALLBACK (decide_policy_cb),
4751+ window);
4752+ g_signal_handlers_disconnect_by_func (view,
4753+ G_CALLBACK (sync_tab_popup_windows),
4754+ window);
4755+ g_signal_handlers_disconnect_by_func (view,
4756+ G_CALLBACK (sync_tab_popups_allowed),
4757+ window);
4758+ g_signal_handlers_disconnect_by_func (view,
4759+ G_CALLBACK (sync_tab_security),
4760+ window);
4761+ g_signal_handlers_disconnect_by_func (view,
4762+ G_CALLBACK (sync_tab_document_type),
4763+ window);
4764+ g_signal_handlers_disconnect_by_func (view,
4765+ G_CALLBACK (sync_tab_load_status),
4766+ window);
4767+ g_signal_handlers_disconnect_by_func (view,
4768+ G_CALLBACK (sync_tab_is_blank),
4769+ window);
4770+ g_signal_handlers_disconnect_by_func (view,
4771+ G_CALLBACK (sync_tab_navigation),
4772+ window);
4773+ g_signal_handlers_disconnect_by_func (embed,
4774+ G_CALLBACK (sync_tab_title),
4775+ window);
4776+ g_signal_handlers_disconnect_by_func (view,
4777+ G_CALLBACK (sync_tab_address),
4778+ window);
4779+ g_signal_handlers_disconnect_by_func (view,
4780+ G_CALLBACK (sync_tab_icon),
4781+ window);
4782+
4783+ g_signal_handlers_disconnect_by_func
4784+ (view, G_CALLBACK (ephy_window_dom_mouse_click_cb), window);
4785+ g_signal_handlers_disconnect_by_func (view,
4786+ G_CALLBACK (populate_context_menu),
4787+ window);
4788+ g_signal_handlers_disconnect_by_func (view,
4789+ G_CALLBACK (ephy_window_mouse_target_changed_cb),
4790+ window);
4791+}
4792+
4793+static void
4794+ephy_window_set_active_tab (EphyWindow *window, EphyEmbed *new_embed)
4795+{
4796+ EphyEmbed *old_embed;
4797+
4798+ g_return_if_fail (EPHY_IS_WINDOW (window));
4799+ g_return_if_fail (gtk_widget_get_toplevel (GTK_WIDGET (new_embed)) == GTK_WIDGET (window));
4800+
4801+ old_embed = window->priv->active_embed;
4802+
4803+ if (old_embed == new_embed) return;
4804+
4805+ if (old_embed != NULL)
4806+ ephy_window_disconnect_active_embed (window);
4807+
4808+ window->priv->active_embed = new_embed;
4809+
4810+ if (new_embed != NULL)
4811+ ephy_window_connect_active_embed (window);
4812+}
4813+
4814+static gboolean
4815+embed_modal_alert_cb (EphyEmbed *embed,
4816+ EphyWindow *window)
4817+{
4818+ const char *address;
4819+
4820+ /* switch the window to the tab, and bring the window to the foreground
4821+ * (since the alert is modal, the user won't be able to do anything
4822+ * with his current window anyway :|)
4823+ */
4824+ impl_set_active_child (EPHY_EMBED_CONTAINER (window), embed);
4825+ gtk_window_present (GTK_WINDOW (window));
4826+
4827+ /* make sure the location entry shows the real URL of the tab's page */
4828+ address = ephy_web_view_get_address (ephy_embed_get_web_view (embed));
4829+ ephy_window_set_location (window, address);
4830+
4831+ /* don't suppress alert */
4832+ return FALSE;
4833+}
4834+
4835+static void
4836+tab_accels_item_activate (GtkAction *action,
4837+ EphyWindow *window)
4838+{
4839+ EphyWindowPrivate *priv = window->priv;
4840+ const char *name;
4841+ int tab_number;
4842+
4843+ name = gtk_action_get_name (action);
4844+ tab_number = atoi (name + strlen ("TabAccel"));
4845+
4846+ gtk_notebook_set_current_page (priv->notebook, tab_number);
4847+}
4848+
4849+static void
4850+tab_accels_update (EphyWindow *window)
4851+{
4852+ EphyWindowPrivate *priv = window->priv;
4853+ int pages, i = 0;
4854+ GList *actions, *l;
4855+
4856+ actions = gtk_action_group_list_actions (priv->tab_accels_action_group);
4857+ pages = gtk_notebook_get_n_pages (priv->notebook);
4858+ for (l = actions; l != NULL; l = l->next)
4859+ {
4860+ GtkAction *action = GTK_ACTION (l->data);
4861+
4862+ gtk_action_set_sensitive (action, (i < pages));
4863+
4864+ i++;
4865+ }
4866+ g_list_free (actions);
4867+}
4868+
4869+#define TAB_ACCELS_N 10
4870+
4871+static void
4872+setup_tab_accels (EphyWindow *window)
4873+{
4874+ EphyWindowPrivate *priv = window->priv;
4875+ guint id;
4876+ int i;
4877+
4878+ id = gtk_ui_manager_new_merge_id (priv->manager);
4879+
4880+ for (i = 0; i < TAB_ACCELS_N; i++)
4881+ {
4882+ GtkAction *action;
4883+ char *name;
4884+ char *accel;
4885+
4886+ name = g_strdup_printf ("TabAccel%d", i);
4887+ accel = g_strdup_printf ("<alt>%d", (i + 1) % TAB_ACCELS_N);
4888+ action = gtk_action_new (name, NULL, NULL, NULL);
4889+
4890+ gtk_action_group_add_action_with_accel (priv->tab_accels_action_group,
4891+ action, accel);
4892+
4893+ g_signal_connect (action, "activate",
4894+ G_CALLBACK (tab_accels_item_activate), window);
4895+ gtk_ui_manager_add_ui (priv->manager, id, "/",
4896+ name, name,
4897+ GTK_UI_MANAGER_ACCELERATOR,
4898+ FALSE);
4899+
4900+ g_object_unref (action);
4901+ g_free (accel);
4902+ g_free (name);
4903+ }
4904+}
4905+
4906+static gboolean
4907+show_notebook_popup_menu (GtkNotebook *notebook,
4908+ EphyWindow *window,
4909+ GdkEventButton *event)
4910+{
4911+ GtkWidget *menu, *tab, *tab_label;
4912+ GtkAction *action;
4913+
4914+ menu = gtk_ui_manager_get_widget (window->priv->manager, "/EphyNotebookPopup");
4915+ g_return_val_if_fail (menu != NULL, FALSE);
4916+
4917+ /* allow extensions to sync when showing the popup */
4918+ action = gtk_action_group_get_action (window->priv->action_group,
4919+ "NotebookPopupAction");
4920+ g_return_val_if_fail (action != NULL, FALSE);
4921+ gtk_action_activate (action);
4922+
4923+ if (event != NULL)
4924+ {
4925+ gint n_pages, page_num;
4926+
4927+ tab = GTK_WIDGET (window->priv->active_embed);
4928+ n_pages = gtk_notebook_get_n_pages (notebook);
4929+ page_num = gtk_notebook_page_num (notebook, tab);
4930+
4931+ /* enable/disable move left/right items*/
4932+ action = gtk_action_group_get_action (window->priv->action_group,
4933+ "TabsMoveLeft");
4934+ gtk_action_set_sensitive (action, page_num > 0);
4935+
4936+ action = gtk_action_group_get_action (window->priv->action_group,
4937+ "TabsMoveRight");
4938+ gtk_action_set_sensitive (action, page_num < n_pages - 1);
4939+
4940+ gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
4941+ NULL, NULL,
4942+ event->button, event->time);
4943+ }
4944+ else
4945+ {
4946+ tab = GTK_WIDGET (window->priv->active_embed);
4947+ tab_label = gtk_notebook_get_tab_label (notebook, tab);
4948+
4949+ gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
4950+ ephy_gui_menu_position_under_widget, tab_label,
4951+ 0, gtk_get_current_event_time ());
4952+ gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE);
4953+ }
4954+
4955+ return TRUE;
4956+}
4957+
4958+static gboolean
4959+notebook_button_press_cb (GtkNotebook *notebook,
4960+ GdkEventButton *event,
4961+ EphyWindow *window)
4962+{
4963+ if (GDK_BUTTON_PRESS == event->type && 3 == event->button)
4964+ {
4965+ return show_notebook_popup_menu (notebook, window, event);
4966+ }
4967+
4968+ return FALSE;
4969+}
4970+
4971+static gboolean
4972+notebook_popup_menu_cb (GtkNotebook *notebook,
4973+ EphyWindow *window)
4974+{
4975+ /* Only respond if the notebook is the actual focus */
4976+ if (EPHY_IS_NOTEBOOK (gtk_window_get_focus (GTK_WINDOW (window))))
4977+ {
4978+ return show_notebook_popup_menu (notebook, window, NULL);
4979+ }
4980+
4981+ return FALSE;
4982+}
4983+
4984+static gboolean
4985+present_on_idle_cb (GtkWindow *window)
4986+{
4987+ gtk_window_present (window);
4988+ return FALSE;
4989+}
4990+
4991+static gboolean
4992+delayed_remove_child (gpointer data)
4993+{
4994+ GtkWidget *widget = GTK_WIDGET (data);
4995+ EphyEmbedContainer *container = EPHY_EMBED_CONTAINER (gtk_widget_get_toplevel (widget));
4996+
4997+ ephy_embed_container_remove_child (container, EPHY_EMBED (widget));
4998+
4999+ return FALSE;
5000+}
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: