This commit is contained in:
parent
96b7ab9388
commit
262cecd371
@ -1,3 +1,86 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 26 01:05:18 CET 2008 - maw@suse.de
|
||||
|
||||
- Merge changes from the build service (thanks, Wolfgang)
|
||||
- Update to the fourth Firefox 3.0 Beta (2.9.94):
|
||||
+ Based upon the Gecko 1.9 Web rendering platform, which improves
|
||||
performance, stability, and rendering correctness; it also
|
||||
boasts a considerable simplification in its code
|
||||
+ Security improvements:
|
||||
* One-click site info
|
||||
* Malware Protection
|
||||
* New Web Forgery Protection page
|
||||
* New SSL error pages
|
||||
* Add-ons and Plugin version check
|
||||
* Secure add-on updates
|
||||
* Effective top-level domain (eTLD) service to better restrict
|
||||
cookies and other restricted content to a single domain
|
||||
* Better protection against cross-site JSON data leaks
|
||||
+ Usability improvements:
|
||||
* Easier password management
|
||||
* Simplified add-on installation
|
||||
* New Download Manager
|
||||
* Resumable downloading
|
||||
* Full page zoom
|
||||
* Podcasts and Videocasts can be associated with your media
|
||||
playback tools
|
||||
* Tab scrolling and quickmenu
|
||||
* Save what you were doing: Firefox will prompt users to save
|
||||
tabs on exit
|
||||
* Optimized Open in Tabs behavior
|
||||
* Location and Search bar size can now be customized with a
|
||||
simple resizer item
|
||||
* Text selection improvements
|
||||
* Find toolbar
|
||||
* Improved integration with Linux: Firefox's default icons,
|
||||
buttons, and menu styles now use the native GTK theme
|
||||
+ Personalization improvements:
|
||||
* Star button: quickly add bookmarks from the location bar
|
||||
with a single click; a second click lets you file and tag them
|
||||
* Tags: associate keywords with your bookmarks to sort them
|
||||
by topic
|
||||
* Location bar & auto-complete
|
||||
* Smart Bookmarks Folder
|
||||
* Places Organizer: view, organize and search through all
|
||||
of your bookmarks, tags, and browsing history with multiple
|
||||
views and smart folders to store your frequent searches
|
||||
* Web-based protocol handlers
|
||||
* Download & Install Add-ons
|
||||
* Easy to use Download Actions
|
||||
+ Improved platform for web developers:
|
||||
* New graphics and font handling: new graphics and text
|
||||
rendering architectures in Gecko 1.9 provides rendering
|
||||
improvements in CSS, SVG as well as improved display of
|
||||
fonts with ligatures and complex scripts
|
||||
* Color management: (set gfx.color_management.enabled on
|
||||
in about:config and restart the browser to enable.);
|
||||
Firefox can now adjust images with embedded color profiles
|
||||
* Offline support: enables web applications to provide
|
||||
offline functionality (website authors must add support
|
||||
for offline browsing to their site for this feature
|
||||
to be available to users)
|
||||
+ Improved performance:
|
||||
* Speed: improvements to the JavaScript engine as well as
|
||||
profile guided optimizations have resulted in significant
|
||||
improvements in performance; compared to Firefox 2,
|
||||
web applications like Google Mail and Zoho Office run
|
||||
twice as fast in Firefox 3 Beta 4, and the popular
|
||||
SunSpider test from Apple shows improvements over
|
||||
previous releases
|
||||
* Memory usage: Several new technologies work together to
|
||||
reduce the amount of memory used by Firefox 3 Beta 4
|
||||
over a web browsing session; memory cycles are broken
|
||||
and collected by an automated cycle collector, a new
|
||||
memory allocator reduces fragmentation, hundreds of leaks
|
||||
have been fixed, and caching strategies have been tuned
|
||||
* Reliability: A user's bookmarks, history, cookies, and
|
||||
preferences are now stored in a transactionally secure
|
||||
database format which will prevent data loss even if their
|
||||
system crashes
|
||||
- This version depends upon the mozilla-xulrunner190 package
|
||||
- Drop various stale packages, respin several that have been
|
||||
kept around, and add a few new ones.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 11 18:18:14 CET 2008 - maw@suse.de
|
||||
|
||||
|
@ -8,5 +8,5 @@ Exec=firefox %u
|
||||
Icon=firefox
|
||||
Terminal=false
|
||||
StartupNotify=true
|
||||
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;
|
||||
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;application/x-xpinstall;
|
||||
Type=Application
|
||||
|
@ -1,35 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Name=Firefox Web Browser
|
||||
Name[en]=Firefox Web Browser
|
||||
Name[cs]=Firefox
|
||||
Name[de]=Firefox-Webbrowser
|
||||
Name[fr]=Navigateur Web Firefox
|
||||
Name[es]=Navegador Web Firefox
|
||||
Name[hu]=Firefox webböngésző
|
||||
Name[it]=Browser Web Firefox
|
||||
Name[ja]=Firefox Webブラウザ
|
||||
Name[pl]=Przeglądarka WWW Firefox
|
||||
Name[pt_BR]=Browser da Web Firefox
|
||||
Name[sk]=Firefox
|
||||
Name[zh_CN]=Firefox 万维网浏览器
|
||||
Name[zh_TW]=Firefox 網頁瀏覽器
|
||||
Comment=Firefox Web Browser
|
||||
Comment[en]=Firefox Web Browser
|
||||
Comment[cs]=Prohlížeč Firefox
|
||||
Comment[de]=Firefox-Webbrowser
|
||||
Comment[fr]=Navigateur Web Firefox
|
||||
Comment[es]=Navegador Web Firefox
|
||||
Comment[hu]=Firefox webböngésző
|
||||
Comment[it]=Browser Web Firefox
|
||||
Comment[ja]=Firefox Webブラウザ
|
||||
Comment[pl]=Przeglądarka WWW Firefox
|
||||
Comment[pt_BR]=Browser da Web Firefox
|
||||
Comment[sk]=Firefox Web Browser
|
||||
Comment[zh_CN]=Firefox 万维网浏览器
|
||||
Comment[zh_TW]=Firefox 網頁瀏覽器
|
||||
TryExec=firefox
|
||||
Exec=firefox %u
|
||||
Icon=firefox
|
||||
Terminal=false
|
||||
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;
|
||||
Type=Application
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package MozillaFirefox (Version 2.0.0.12)
|
||||
# spec file for package MozillaFirefox (Version 2.9.94)
|
||||
#
|
||||
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# This file and all modifications and additions to the pristine
|
||||
@ -12,145 +12,46 @@
|
||||
|
||||
|
||||
Name: MozillaFirefox
|
||||
# Checklist for updating:
|
||||
# * Copy new sources (don't forget l10n-%{version}.tar.bz2) and patches
|
||||
# to your package checkout.
|
||||
# * Increment Version: as necessary
|
||||
# * Update releasedate
|
||||
# * Ensure patches are in sync among all releases
|
||||
# * configure.patch should be the last patch applied against the mozilla
|
||||
# source itself; the following patches apply to other tarballs.
|
||||
# * configure.patch is regenerated (when necessary) by applying
|
||||
# pango-cairo.patch, dbus.patch, startup.patch to an unpacked source,
|
||||
# and then running autoconf 2.13. debian.suse.de used to have this
|
||||
# version installed. For more info see
|
||||
# http://developer.mozilla.org/en/docs/How_Mozilla's_build_system_works
|
||||
# * Update the .changes file
|
||||
# * Update this checklist if necessary and keep it in sync on all supported
|
||||
# platforms.
|
||||
BuildRequires: gcc-c++ libgnomeui-devel libidl-devel mozilla-nss-devel orbit-devel startup-notification-devel unzip update-desktop-files zip
|
||||
%if %suse_version <= 1010
|
||||
BuildRequires: dbus-1-devel
|
||||
%else
|
||||
BuildRequires: dbus-1-glib-devel
|
||||
%endif
|
||||
BuildRequires: gcc-c++ libgnomeui-devel libidl-devel mozilla-xulrunner190-devel orbit-devel python unzip update-desktop-files zip
|
||||
%if %suse_version > 1020
|
||||
BuildRequires: fdupes
|
||||
%endif
|
||||
License: GPL v2 or later; LGPL v2.1 or later; MOZILLA PUBLIC LICENSE (MPL/NPL)
|
||||
Provides: web_browser
|
||||
Provides: firefox
|
||||
Provides: MozillaFirebird
|
||||
Obsoletes: MozillaFirebird <= 1.0.7
|
||||
%if %sles_version == 10
|
||||
Obsoletes: mozilla
|
||||
%endif
|
||||
Version: 2.0.0.12
|
||||
Release: 1
|
||||
Version: 2.9.94
|
||||
Release: 2
|
||||
Summary: Mozilla Firefox Web Browser
|
||||
Url: http://www.mozilla.org/
|
||||
Group: Productivity/Networking/Web/Browsers
|
||||
# Creation of firefox and l10n tarballs:
|
||||
# cvs -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot co -r MOZILLA_1_8_BRANCH mozilla/client.mk
|
||||
# cd mozilla
|
||||
# export MOZ_CO_PROJECT=browser
|
||||
# export MOZ_CO_LOCALES=all
|
||||
# make -f client.mk checkout
|
||||
# cd ..
|
||||
# tar cjf l10n.tar.bz2 l10n; tar cjf firefox-%{version}-source.tar.bz2 mozilla
|
||||
Source: firefox-%{version}-source.tar.bz2
|
||||
Source1: MozillaFirefox.desktop
|
||||
Source2: add-plugins.sh.in
|
||||
Source3: mozilla.sh.in
|
||||
Source4: tango-theme.tar.bz2
|
||||
Source4: find-external-requires.sh
|
||||
Source5: search-addons.tar.bz2
|
||||
Source6: MozillaFirefox.desktop.nld
|
||||
Source7: l10n-%{version}.tar.bz2
|
||||
Source8: plastikfox-theme.tar.bz2
|
||||
Source9: bookmarks.html.nld
|
||||
Source8: firefox-mimeinfo.xml
|
||||
Source10: bookmarks.html.suse
|
||||
Source11: firefox48.png
|
||||
Source16: firefox.1
|
||||
Source17: firefox-suse-default-prefs.js
|
||||
Source18: firefox.schemas
|
||||
Source19: MozillaFirefox.xml
|
||||
Patch1: visibility.patch
|
||||
Patch2: rpath.patch
|
||||
Patch3: gcc-undefined-ops.patch
|
||||
Patch4: mozilla-gcc4.3-fixes.patch
|
||||
Patch5: abuild.patch
|
||||
# NSPR bmo #270502
|
||||
Patch6: nspr-prdtoa.patch
|
||||
Patch7: locale.patch
|
||||
# lockdown infrastructure
|
||||
Patch8: firefox-ui-lockdown.patch
|
||||
Patch9: gecko-lockdown.patch
|
||||
Patch10: gconf-backend.patch
|
||||
Patch11: gnome-vfs.patch
|
||||
Patch12: misc.dif
|
||||
Patch13: nss-opt.patch
|
||||
Patch1: firefox-libxul-sdk.patch
|
||||
Patch2: firefox-no-update.patch
|
||||
Patch14: credits.patch
|
||||
Patch15: em-356370.patch
|
||||
# bmo #273524 (only for NLD)
|
||||
Patch16: gnome-vfs-default.patch
|
||||
# integration
|
||||
Patch17: firefox-appname.patch
|
||||
Patch18: firefox-no-update.patch
|
||||
Patch19: dbus.patch
|
||||
Patch20: mozilla-path_len.patch
|
||||
# customization
|
||||
Patch22: cjk-postscript-fonts.dif
|
||||
Patch23: startup.patch
|
||||
# bmo #324060
|
||||
Patch24: cups-paper.patch
|
||||
Patch25: system-extensions.patch
|
||||
Patch27: system-proxies.patch
|
||||
# bmo #331522
|
||||
Patch32: postscript.patch
|
||||
Patch33: proxy-dev.patch
|
||||
# integration
|
||||
Patch34: skin-selection.patch
|
||||
Patch36: greasemonkey.patch
|
||||
Patch38: tango-maxversion.patch
|
||||
Patch39: x11-session.patch
|
||||
Patch40: firefox-348446-empty-lists.patch
|
||||
# gconf.patch dbus.patch startup.patch
|
||||
Patch100: configure.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
PreReq: libstdc++ fileutils textutils /bin/sh gconf2 shared-mime-info desktop-file-utils
|
||||
%if %suse_version < 1030
|
||||
Requires: /usr/lib/libaoss.so
|
||||
%endif
|
||||
%define opensuse_bs 0
|
||||
%if %sles_version == 10
|
||||
%define default_home_page http://www.novell.com/linux/sle10
|
||||
%else
|
||||
%define default_home_page http://www.opensuse.org
|
||||
%endif
|
||||
%define has_system_nspr 0
|
||||
%define has_system_nss 0
|
||||
%define has_system_cairo 0
|
||||
%if %suse_version > 930 || %opensuse_bs
|
||||
%define has_system_nspr 1
|
||||
%define has_system_cairo 1
|
||||
%endif
|
||||
%if %suse_version > 1010 || %opensuse_bs
|
||||
%define has_system_nss 1
|
||||
%endif
|
||||
%if %has_system_nspr
|
||||
Requires: mozilla-nspr >= %( echo `rpm -q --queryformat '%{VERSION}' mozilla-nspr`)
|
||||
%endif
|
||||
%if %has_system_nss
|
||||
Requires: mozilla-nss >= %( echo `rpm -q --queryformat '%{VERSION}' mozilla-nss`)
|
||||
%endif
|
||||
PreReq: fileutils textutils /bin/sh gconf2 shared-mime-info desktop-file-utils
|
||||
Requires: mozilla-xulrunner190 >= %( echo `rpm -q --queryformat '%{VERSION}-%{RELEASE}' mozilla-xulrunner190`)
|
||||
%define default_home_page http://www.opensuse.org/
|
||||
%define _unpackaged_files_terminate_build 0
|
||||
%define releasedate 2008020300
|
||||
%define _use_internal_dependency_generator 0
|
||||
%define __find_requires sh %{SOURCE4}
|
||||
%define __find_provides %{nil}
|
||||
%define releasedate 2008030800
|
||||
%define progname firefox
|
||||
%if %suse_version < 1010
|
||||
%define progdir /opt/MozillaFirefox/%_lib
|
||||
%else
|
||||
%define progdir %{_prefix}/%_lib/firefox
|
||||
%endif
|
||||
%define libgssapi libgssapi_krb5.so.2
|
||||
%if %suse_version > 1020
|
||||
%define gnome_confdir %{_sysconfdir}
|
||||
%define gnome_dir %{_prefix}
|
||||
@ -159,18 +60,9 @@ Requires: mozilla-nss >= %( echo `rpm -q --queryformat '%{VERSION}' mozill
|
||||
%define gnome_confdir %{_sysconfdir}/opt/gnome
|
||||
%define gnome_dir /opt/gnome
|
||||
%endif
|
||||
%define nld9 %(if grep -q sles9-sld /.buildenv; then echo 1; else echo 0; fi)
|
||||
%define my_provides /tmp/my-provides
|
||||
%define my_requires /tmp/my-requires
|
||||
%if %suse_version > 920
|
||||
%define libgssapi libgssapi_krb5.so.2
|
||||
%else
|
||||
%define libgssapi libgssapi.so.1
|
||||
%endif
|
||||
### build options
|
||||
%define milestone 1
|
||||
%define localize 1
|
||||
%define broken 0
|
||||
### build options end
|
||||
|
||||
%description
|
||||
@ -188,9 +80,10 @@ Authors:
|
||||
|
||||
%package translations
|
||||
Summary: Translations for MozillaFirefox
|
||||
Provides: locale(MozillaFirefox:af;ar;bg;be;ca;cs;da;de;el;en_GB;es_AR;es_ES;eu;fi;fr;fy_NL;ga_IE;gu_IN;he;hu;it;ja;ka;ko;ku;lt;mk;mn;nb_NO;nl;nn_NO;pa_IN;pl;pt_BR;pt_PT;ro;ru;sk;sl;sv_SE;tr;zh_CN;zh_TW)
|
||||
Provides: locale(%{name}:ar;be;ca;cs;da;de;el;en-GB;es_AR;es_ES;eu;fi;fr;fy_NL;ga_IE;gu_IN;he;hu;it;ja;ka;ko;lt;mk;nb_NO;nl;pa_IN;pl;pt_BR;pt_PT;ro;ru;sk;sq;sv_SE;tr;uk;zh_CN;zh_TW)
|
||||
Group: Productivity/Networking/Web/Browsers
|
||||
PreReq: %{name} = %{version}
|
||||
Requires: mozilla-xulrunner190-lang
|
||||
|
||||
%description translations
|
||||
This package contains several optional languages for the user interface
|
||||
@ -203,68 +96,23 @@ Authors:
|
||||
Mozilla Foundation <drivers@mozilla.org>
|
||||
|
||||
%prep
|
||||
%setup -q -n mozilla -b 7 -b 4 -b 8
|
||||
%setup -q -n mozilla -b 7
|
||||
cd $RPM_BUILD_DIR/mozilla
|
||||
%patch1
|
||||
%patch2
|
||||
%patch3
|
||||
%patch4
|
||||
%patch5
|
||||
%patch6
|
||||
%patch7
|
||||
# lockdown stuff
|
||||
%patch8 -p1
|
||||
%patch9
|
||||
%patch10
|
||||
%patch11
|
||||
%patch12
|
||||
%patch13
|
||||
%patch14
|
||||
%patch15
|
||||
%patch17
|
||||
%patch18
|
||||
%patch19
|
||||
%patch20 -p1
|
||||
# system NSS
|
||||
%patch22
|
||||
%patch23
|
||||
%patch24
|
||||
%patch25
|
||||
%patch27
|
||||
%if %nld9
|
||||
%patch16
|
||||
%endif
|
||||
%patch32
|
||||
%patch33 -p1
|
||||
%patch34
|
||||
%patch36
|
||||
pushd $RPM_BUILD_DIR
|
||||
%patch38
|
||||
popd
|
||||
%patch39 -p1
|
||||
%patch40 -p1
|
||||
%patch100
|
||||
%if %has_system_nss
|
||||
#%patch101
|
||||
%endif
|
||||
# custom bookmarks
|
||||
%if %nld9
|
||||
cp -f %{SOURCE9} $RPM_BUILD_DIR/mozilla/browser/locales/en-US/profile/bookmarks.html
|
||||
%else
|
||||
cp -f %{SOURCE10} $RPM_BUILD_DIR/mozilla/browser/locales/en-US/profile/bookmarks.html
|
||||
%endif
|
||||
|
||||
%build
|
||||
export MOZ_BUILD_DATE=%{releasedate}
|
||||
export MOZILLA_OFFICIAL=1
|
||||
export BUILD_OFFICIAL=1
|
||||
export CFLAGS="$RPM_OPT_FLAGS -Os -fno-strict-aliasing -ftree-vrp -fwrapv"
|
||||
%if %suse_version > 1000
|
||||
export CFLAGS="$CFLAGS -fstack-protector"
|
||||
%endif
|
||||
export CFLAGS="$RPM_OPT_FLAGS -g -Os -fno-strict-aliasing -fstack-protector"
|
||||
export CXXFLAGS="$CFLAGS"
|
||||
export RPATH="-Wl,-rpath -Wl,%{progdir}"
|
||||
export MOZCONFIG=$RPM_BUILD_DIR/mozconfig
|
||||
SDKDIR=$(pkg-config --variable=sdkdir libxul)
|
||||
cat << EOF > $MOZCONFIG
|
||||
mk_add_options MOZILLA_OFFICIAL=1
|
||||
mk_add_options BUILD_OFFICIAL=1
|
||||
@ -275,54 +123,18 @@ ac_add_options --libdir=%{_libdir}
|
||||
ac_add_options --sysconfdir=%{_sysconfdir}
|
||||
ac_add_options --mandir=%{_mandir}
|
||||
ac_add_options --includedir=%{_includedir}
|
||||
ac_add_options --enable-optimize="$CFLAGS"
|
||||
ac_add_options --with-system-nspr
|
||||
ac_add_options --with-system-nss
|
||||
ac_add_options --with-libxul-sdk=$SDKDIR
|
||||
ac_add_options --with-system-jpeg
|
||||
ac_add_options --with-system-png
|
||||
ac_add_options --with-system-mng
|
||||
#ac_add_options --with-system-png # doesn't work because of missing APNG support
|
||||
ac_add_options --with-system-zlib
|
||||
ac_add_options --enable-default-toolkit=gtk2
|
||||
ac_add_options --enable-gconf
|
||||
ac_add_options --enable-svg
|
||||
ac_add_options --enable-canvas
|
||||
ac_add_options --enable-xft
|
||||
ac_add_options --disable-freetype2
|
||||
#ac_add_options --enable-gconf # not ported yet
|
||||
ac_add_options --disable-installer
|
||||
ac_add_options --enable-static
|
||||
ac_add_options --disable-shared
|
||||
ac_add_options --disable-tests
|
||||
ac_add_options --disable-debug
|
||||
ac_add_options --disable-crashreporter
|
||||
EOF
|
||||
%if %is_plus || %suse_version >= 930
|
||||
cat << EOF >> $MOZCONFIG
|
||||
ac_add_options --enable-pango
|
||||
EOF
|
||||
%endif
|
||||
%if %has_system_nspr
|
||||
cat << EOF >> $MOZCONFIG
|
||||
ac_add_options --with-system-nspr
|
||||
EOF
|
||||
%endif
|
||||
%if %has_system_nss
|
||||
cat << EOF >> $MOZCONFIG
|
||||
ac_add_options --with-system-nss
|
||||
EOF
|
||||
%endif
|
||||
%if %has_system_cairo
|
||||
cat << EOF >> $MOZCONFIG
|
||||
ac_add_options --enable-system-cairo
|
||||
EOF
|
||||
%endif
|
||||
%if %suse_version >= 1000
|
||||
cat << EOF >> $MOZCONFIG
|
||||
ac_add_options --enable-dbus
|
||||
ac_add_options --enable-extensions="dbus default"
|
||||
EOF
|
||||
%endif
|
||||
%if %suse_version >= 1010
|
||||
cat << EOF >> $MOZCONFIG
|
||||
ac_add_options --enable-startup-notification
|
||||
EOF
|
||||
%endif
|
||||
%if %milestone
|
||||
cat << EOF >> $MOZCONFIG
|
||||
ac_add_options --enable-official-branding
|
||||
@ -338,10 +150,9 @@ cp -rf $RPM_BUILD_DIR/mozilla/dist/firefox/* $RPM_BUILD_ROOT/%{progdir}
|
||||
# install additional locales
|
||||
%if %localize
|
||||
echo %defattr\(-,root,root\) > %{_tmppath}/translations.list
|
||||
#for locale in $(cat browser/locales/all-locales); do
|
||||
for locale in $(awk '{ print $1; }' browser/locales/shipped-locales); do
|
||||
case $locale in
|
||||
ja-JP-mac)
|
||||
ja-JP-mac)
|
||||
# broken locales, do not work
|
||||
;;
|
||||
*)
|
||||
@ -365,39 +176,16 @@ s:%%PROFILE:.mozilla/firefox:g" \
|
||||
chmod 755 $RPM_BUILD_ROOT%{progdir}/%{progname}.sh
|
||||
ln -sf ../..%{progdir}/%{progname}.sh $RPM_BUILD_ROOT/usr/bin/%{progname}
|
||||
# desktop definition
|
||||
%if %nld9
|
||||
mkdir -p $RPM_BUILD_ROOT/opt/gnome/share/applications
|
||||
install -m 644 %{SOURCE6} \
|
||||
$RPM_BUILD_ROOT/opt/gnome/share/applications/%{name}.desktop
|
||||
%else
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/share/applications
|
||||
%if %suse_version < 1010
|
||||
# no startup notification for 10.0 and older
|
||||
sed "s:StartupNotify=true:StartupNotify=false:g" \
|
||||
%{SOURCE1} > $RPM_BUILD_ROOT/usr/share/applications/%{name}.desktop
|
||||
%else
|
||||
install -m 644 %{SOURCE1} \
|
||||
$RPM_BUILD_ROOT/usr/share/applications
|
||||
%endif
|
||||
%endif
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/mime/packages
|
||||
cp %{S:19} $RPM_BUILD_ROOT/%{_datadir}/mime/packages
|
||||
# additional mime-types
|
||||
mkdir -p $RPM_BUILD_ROOT%{_datadir}/mime/packages
|
||||
cp %{SOURCE8} $RPM_BUILD_ROOT%{_datadir}/mime/packages/firefox.xml
|
||||
# SCHEMA File
|
||||
mkdir -p $RPM_BUILD_ROOT/%{gnome_confdir}/gconf/schemas
|
||||
mkdir -p $RPM_BUILD_ROOT%{gnome_confdir}/gconf/schemas
|
||||
install -m 644 %{SOURCE18} \
|
||||
$RPM_BUILD_ROOT/%{gnome_confdir}/gconf/schemas/
|
||||
# Themes
|
||||
cp -a $RPM_BUILD_DIR/tango\@novell.com $RPM_BUILD_ROOT%{progdir}/extensions/
|
||||
%if %broken
|
||||
cp -a $RPM_BUILD_DIR/\{4674e8a2-eb7e-4822-b517-b18328b3e8e8\} $RPM_BUILD_ROOT%{progdir}/extensions/
|
||||
%endif
|
||||
# install add-plugins.sh
|
||||
%if %suse_version <= 1000
|
||||
sed "s:%%PROGDIR:%{progdir}:g
|
||||
s:%%APPNAME:%{progname}:g" \
|
||||
%{SOURCE2} > $RPM_BUILD_ROOT%{progdir}/add-plugins.sh
|
||||
chmod 755 $RPM_BUILD_ROOT%{progdir}/add-plugins.sh
|
||||
%endif
|
||||
# install man-page
|
||||
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1/
|
||||
cp %{SOURCE16} $RPM_BUILD_ROOT%{_mandir}/man1/
|
||||
@ -405,10 +193,10 @@ cp %{SOURCE16} $RPM_BUILD_ROOT%{_mandir}/man1/
|
||||
sed -e 's,RPM_VERSION,%{version}-%{release},g
|
||||
s,GSSAPI,%{libgssapi},g' \
|
||||
%{SOURCE17} > suse-default-prefs
|
||||
cp suse-default-prefs $RPM_BUILD_ROOT/%{progdir}/defaults/pref/firefox-novell.js
|
||||
cp suse-default-prefs $RPM_BUILD_ROOT/%{progdir}/defaults/preferences/firefox-novell.js
|
||||
rm suse-default-prefs
|
||||
# use correct locale for useragent
|
||||
cat > $RPM_BUILD_ROOT%{progdir}/defaults/pref/firefox-l10n.js << EOF
|
||||
cat > $RPM_BUILD_ROOT%{progdir}/defaults/preferences/firefox-l10n.js << EOF
|
||||
pref("general.useragent.locale", "chrome://global/locale/intl.properties");
|
||||
EOF
|
||||
##########
|
||||
@ -425,58 +213,45 @@ EOF
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps/
|
||||
%if %milestone
|
||||
cp -f other-licenses/branding/firefox/mozicon128.png $RPM_BUILD_ROOT/usr/share/pixmaps/firefox.png
|
||||
mkdir -p $RPM_BUILD_ROOT/%{gnome_dir}/share/icons/hicolor/48x48/apps/
|
||||
install -m 0644 %{SOURCE11} $RPM_BUILD_ROOT/%{gnome_dir}/share/icons/hicolor/48x48/apps/firefox.png
|
||||
mkdir -p $RPM_BUILD_ROOT%{gnome_dir}/share/icons/hicolor/48x48/apps/
|
||||
install -m 644 %{SOURCE11} $RPM_BUILD_ROOT%{gnome_dir}/share/icons/hicolor/48x48/apps/firefox.png
|
||||
ln -sf firefox.png $RPM_BUILD_ROOT/usr/share/pixmaps/firefox-gnome.png
|
||||
%else
|
||||
cp -f $RPM_BUILD_ROOT%{progdir}/icons/mozicon50.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/firefox.xpm
|
||||
%endif
|
||||
%suse_update_desktop_file %{name} Network WebBrowser X-Ximian-Main X-Ximian-Toplevel GTK
|
||||
%if %has_system_nspr && !%has_system_nss
|
||||
# modify provides and requires lists (don't export NSS)
|
||||
cat << EOF > %{my_provides}
|
||||
grep -vE "libnss3.so|libnssckbi.so|libsmime3.so|libsoftokn3.so|libssl3.so" | %{__find_provides}
|
||||
EOF
|
||||
chmod 755 %{my_provides}
|
||||
%define __find_provides %{my_provides}
|
||||
cat << EOF > %{my_requires}
|
||||
grep -vE "libnss3.so|libnssckbi.so|libsmime3.so|libsoftokn3.so|libssl3.so|firefox-bin" | %{__find_requires}
|
||||
EOF
|
||||
chmod 755 %{my_requires}
|
||||
%define __find_requires %{my_requires}
|
||||
%endif
|
||||
%find_gconf_schemas
|
||||
%if %suse_version > 1020
|
||||
%fdupes $RPM_BUILD_ROOT%_libdir
|
||||
%fdupes $RPM_BUILD_ROOT%_docdir
|
||||
%find_gconf_schemas
|
||||
%fdupes $RPM_BUILD_ROOT%{progdir}
|
||||
%fdupes $RPM_BUILD_ROOT%{_datadir}
|
||||
%endif
|
||||
%if %milestone
|
||||
chmod -x $RPM_BUILD_ROOT%{_datadir}/pixmaps/firefox.png
|
||||
%endif
|
||||
chmod -x $RPM_BUILD_ROOT/usr/share/pixmaps/firefox.png
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%if %has_system_nspr && !%has_system_nss
|
||||
rm -f %{my_provides}
|
||||
rm -f %{my_requires}
|
||||
%endif
|
||||
%if %suse_version > 1020
|
||||
|
||||
%pre -f %{name}.schemas_pre
|
||||
|
||||
%preun -f %{name}.schemas_preun
|
||||
%endif
|
||||
|
||||
%post
|
||||
# update mime and desktop database
|
||||
if [ -f usr/bin/update-mime-database ] ; then
|
||||
usr/bin/update-mime-database %{_datadir}/mime >/dev/null || true
|
||||
usr/bin/update-mime-database %{_datadir}/mime > /dev/null || :
|
||||
fi
|
||||
%if %suse_version >= 1030
|
||||
if [ -f usr/bin/update-desktop-database ] ; then
|
||||
usr/bin/update-desktop-database >/dev/null || true
|
||||
usr/bin/update-desktop-database > /dev/null || :
|
||||
fi
|
||||
%else
|
||||
if [ -f opt/gnome/bin/update-mime-database ] ; then
|
||||
opt/gnome/bin/update-mime-database >/dev/null || true
|
||||
opt/gnome/bin/update-mime-database > /dev/null || :
|
||||
fi
|
||||
%endif
|
||||
%if %suse_version >= 1010
|
||||
# move plugins to new location
|
||||
if [ "$1" = "2" ]; then
|
||||
if [ -d /opt/MozillaFirefox/%{_lib}/plugins ]; then
|
||||
@ -485,115 +260,67 @@ if [ "$1" = "2" ]; then
|
||||
rm -rf /opt/MozillaFirefox/%{_lib}/plugins
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
%if %suse_version <= 1020
|
||||
if [ ! -f /.buildenv ]; then
|
||||
export GCONF_CONFIG_SOURCE=`%{gnome_dir}/bin/gconftool-2 --get-default-source`
|
||||
%{gnome_dir}/bin/gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/firefox.schemas > /dev/null 2>&1
|
||||
%if %suse_version <= 1000
|
||||
# restart gconfd
|
||||
killall -HUP gconfd-2 2>&1 >/dev/null
|
||||
%endif
|
||||
%{gnome_dir}bin/gconftool-2 --makefile-install-rule %{gnome_confdir}/gconf/schemas/firefox.schemas > /dev/null 2>&1
|
||||
fi
|
||||
%if %suse_version <= 1000
|
||||
%{progdir}/add-plugins.sh > /dev/null 2>&1
|
||||
%endif
|
||||
exit 0
|
||||
%if %suse_version <= 1000
|
||||
%posttrans -f %{name}.schemas_posttrans
|
||||
|
||||
%postun
|
||||
if [ -f usr/bin/update-mime-database ] ; then
|
||||
usr/bin/update-mime-database %{_datadir}/mime >/dev/null || true
|
||||
usr/bin/update-mime-database %{_datadir}/mime > /dev/null || :
|
||||
fi
|
||||
%if %suse_version >= 1030
|
||||
if [ -f usr/bin/update-desktop-database ] ; then
|
||||
usr/bin/update-desktop-database >/dev/null || true
|
||||
usr/bin/update-desktop-database > /dev/null || :
|
||||
fi
|
||||
%else
|
||||
if [ -f opt/gnome/bin/update-mime-database ] ; then
|
||||
opt/gnome/bin/update-mime-database >/dev/null || true
|
||||
opt/gnome/bin/update-mime-database > /dev/null || :
|
||||
fi
|
||||
%endif
|
||||
|
||||
%triggerin -- IBMJava2-JRE, java2-jre, java2, IBMJava2-SDK, BlackdownJava2-JRE, java-1_4_2-sun-plugin, java-1_5_0-sun-plugin
|
||||
%{progdir}/add-plugins.sh > /dev/null 2>&1
|
||||
exit 0
|
||||
|
||||
%triggerpostun -- IBMJava2-JRE, java2-jre, java2, IBMJava2-SDK, BlackdownJava2-JRE, java-1_4_2-sun-plugin, java-1_5_0-sun-plugin
|
||||
if [ -L %{progdir}/plugins/libjavaplugin_oji.so -a ! -f %{progdir}/plugins/libjavaplugin_oji.so ]; then
|
||||
rm -f %{progdir}/plugins/libjavaplugin_oji.so
|
||||
fi
|
||||
%{progdir}/add-plugins.sh > /dev/null 2>&1
|
||||
exit 0
|
||||
%if %suse_version > 1020
|
||||
%posttrans -f %{name}.schemas_posttrans
|
||||
%endif
|
||||
%if %suse_version > 1020
|
||||
|
||||
%files -f %{name}.schemas_list
|
||||
%defattr(-,root,root)
|
||||
%if %suse_version < 1010
|
||||
%dir /opt/MozillaFirefox
|
||||
%else
|
||||
|
||||
%files
|
||||
%endif
|
||||
%defattr(-,root,root)
|
||||
%dir %{progdir}
|
||||
%dir %{progdir}/chrome/
|
||||
%{progdir}/chrome/browser.*
|
||||
%{progdir}/chrome/classic.*
|
||||
%{progdir}/chrome/comm.*
|
||||
%{progdir}/chrome/en-US.*
|
||||
%{progdir}/chrome/pippki.*
|
||||
%{progdir}/chrome/toolkit.*
|
||||
%{progdir}/chrome/reporter.*
|
||||
%{progdir}/chrome/icons
|
||||
%{progdir}/components/
|
||||
%{progdir}/greprefs/
|
||||
%{progdir}/defaults/
|
||||
%{progdir}/dictionaries/
|
||||
%{progdir}/extensions/
|
||||
%{progdir}/icons/
|
||||
#%{progdir}/init.d/
|
||||
%dir %{progdir}/plugins
|
||||
%{progdir}/plugins/libnullplugin.so
|
||||
%{progdir}/res/
|
||||
%{progdir}/searchplugins/
|
||||
%if %suse_version <= 1000
|
||||
%{progdir}/add-plugins.sh
|
||||
%endif
|
||||
%{progdir}/%{progname}-bin
|
||||
%{progdir}/modules/
|
||||
%attr(755,root,root) %{progdir}/%{progname}.sh
|
||||
%{progdir}/browserconfig.properties
|
||||
# NSPR
|
||||
%if ! %has_system_nspr
|
||||
%{progdir}/libnspr4.so
|
||||
%{progdir}/libplc4.so
|
||||
%{progdir}/libplds4.so
|
||||
%endif
|
||||
# NSS
|
||||
%if ! %has_system_nss
|
||||
%{progdir}/libnssckbi.so
|
||||
%{progdir}/libnss3.so
|
||||
%{progdir}/libsmime3.so
|
||||
%{progdir}/libsoftokn3.chk
|
||||
%{progdir}/libsoftokn3.so
|
||||
%{progdir}/libssl3.so
|
||||
%endif
|
||||
#
|
||||
%{progdir}/libmozjs.so
|
||||
%{progdir}/libxpcom.so
|
||||
%{progdir}/libxpcom_core.so
|
||||
%{progdir}/libxpcom_compat.so
|
||||
%{progdir}/libxpistub.so
|
||||
%{progdir}/mozilla-xremote-client
|
||||
%{progdir}/run-mozilla.sh
|
||||
%{progdir}/updater
|
||||
%{progdir}/updater.ini
|
||||
%{progdir}/xpicleanup
|
||||
%{progdir}/application.ini
|
||||
%{progdir}/firefox
|
||||
%exclude %{progdir}/updater.ini
|
||||
%exclude %{progdir}/removed-files
|
||||
%exclude %{progdir}/firefox
|
||||
%{progdir}/readme.txt
|
||||
%if %nld9
|
||||
/opt/gnome/share/applications/%{name}.desktop
|
||||
%else
|
||||
%exclude %{progdir}/README.txt
|
||||
%exclude %{progdir}/old-homepage-default.properties
|
||||
%exclude %{progdir}/components/libnkgnomevfs.so
|
||||
%exclude %{progdir}/run-mozilla.sh
|
||||
%exclude %{progdir}/libjemalloc.so
|
||||
/usr/share/applications/%{name}.desktop
|
||||
%endif
|
||||
%if %suse_version <= 1020
|
||||
%{gnome_confdir}/gconf/schemas/firefox.schemas
|
||||
%endif
|
||||
%{_datadir}/mime/packages/firefox.xml
|
||||
/usr/share/pixmaps/firefox*
|
||||
%if %milestone
|
||||
%{gnome_dir}/share/icons/hicolor/
|
||||
@ -605,8 +332,87 @@ exit 0
|
||||
%files translations -f %{_tmppath}/translations.list
|
||||
%defattr(-,root,root)
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Wed Mar 26 2008 maw@suse.de
|
||||
- Merge changes from the build service (thanks, Wolfgang)
|
||||
- Update to the fourth Firefox 3.0 Beta (2.9.94):
|
||||
+ Based upon the Gecko 1.9 Web rendering platform, which improves
|
||||
performance, stability, and rendering correctness; it also
|
||||
boasts a considerable simplification in its code
|
||||
+ Security improvements:
|
||||
* One-click site info
|
||||
* Malware Protection
|
||||
* New Web Forgery Protection page
|
||||
* New SSL error pages
|
||||
* Add-ons and Plugin version check
|
||||
* Secure add-on updates
|
||||
* Effective top-level domain (eTLD) service to better restrict
|
||||
cookies and other restricted content to a single domain
|
||||
* Better protection against cross-site JSON data leaks
|
||||
+ Usability improvements:
|
||||
* Easier password management
|
||||
* Simplified add-on installation
|
||||
* New Download Manager
|
||||
* Resumable downloading
|
||||
* Full page zoom
|
||||
* Podcasts and Videocasts can be associated with your media
|
||||
playback tools
|
||||
* Tab scrolling and quickmenu
|
||||
* Save what you were doing: Firefox will prompt users to save
|
||||
tabs on exit
|
||||
* Optimized Open in Tabs behavior
|
||||
* Location and Search bar size can now be customized with a
|
||||
simple resizer item
|
||||
* Text selection improvements
|
||||
* Find toolbar
|
||||
* Improved integration with Linux: Firefox's default icons,
|
||||
buttons, and menu styles now use the native GTK theme
|
||||
+ Personalization improvements:
|
||||
* Star button: quickly add bookmarks from the location bar
|
||||
with a single click; a second click lets you file and tag them
|
||||
* Tags: associate keywords with your bookmarks to sort them
|
||||
by topic
|
||||
* Location bar & auto-complete
|
||||
* Smart Bookmarks Folder
|
||||
* Places Organizer: view, organize and search through all
|
||||
of your bookmarks, tags, and browsing history with multiple
|
||||
views and smart folders to store your frequent searches
|
||||
* Web-based protocol handlers
|
||||
* Download & Install Add-ons
|
||||
* Easy to use Download Actions
|
||||
+ Improved platform for web developers:
|
||||
* New graphics and font handling: new graphics and text
|
||||
rendering architectures in Gecko 1.9 provides rendering
|
||||
improvements in CSS, SVG as well as improved display of
|
||||
fonts with ligatures and complex scripts
|
||||
* Color management: (set gfx.color_management.enabled on
|
||||
in about:config and restart the browser to enable.);
|
||||
Firefox can now adjust images with embedded color profiles
|
||||
* Offline support: enables web applications to provide
|
||||
offline functionality (website authors must add support
|
||||
for offline browsing to their site for this feature
|
||||
to be available to users)
|
||||
+ Improved performance:
|
||||
* Speed: improvements to the JavaScript engine as well as
|
||||
profile guided optimizations have resulted in significant
|
||||
improvements in performance; compared to Firefox 2,
|
||||
web applications like Google Mail and Zoho Office run
|
||||
twice as fast in Firefox 3 Beta 4, and the popular
|
||||
SunSpider test from Apple shows improvements over
|
||||
previous releases
|
||||
* Memory usage: Several new technologies work together to
|
||||
reduce the amount of memory used by Firefox 3 Beta 4
|
||||
over a web browsing session; memory cycles are broken
|
||||
and collected by an automated cycle collector, a new
|
||||
memory allocator reduces fragmentation, hundreds of leaks
|
||||
have been fixed, and caching strategies have been tuned
|
||||
* Reliability: A user's bookmarks, history, cookies, and
|
||||
preferences are now stored in a transactionally secure
|
||||
database format which will prevent data loss even if their
|
||||
system crashes
|
||||
- This version depends upon the mozilla-xulrunner190 package
|
||||
- Drop various stale packages, respin several that have been
|
||||
kept around, and add a few new ones.
|
||||
* Mon Feb 11 2008 maw@suse.de
|
||||
- Security update to version 2.0.0.12 (bnc#354469):
|
||||
+ MFSA 2008-11/CVE-2008-0594 Web forgery overwrite with div
|
||||
|
129
abuild.patch
129
abuild.patch
@ -1,129 +0,0 @@
|
||||
From: Wolfgang Rosenauer <stark@suse.de>
|
||||
Subject: Fix compiler warnings which disturb autobuild
|
||||
References:
|
||||
|
||||
### autobuild
|
||||
... testing for serious compiler warnings
|
||||
Program is using uninitialized variables. Note the difference between "is used"
|
||||
and "may be used". Please investigate and fix.
|
||||
Problematic file(s) and their linenumbers:
|
||||
certificate.c: 541
|
||||
nsUnicodeToJamoTTF.cpp: 855
|
||||
nsObjectFrame.cpp: 1933
|
||||
###
|
||||
|
||||
### autobuild
|
||||
... testing for serious compiler warnings
|
||||
Program returns random data in a function. Please fix.
|
||||
Problematic file(s) and their linenumbers:
|
||||
nsWebShell.cpp: 562
|
||||
nsOperaProfileMigrator.cpp: 831
|
||||
Program is using uninitialized variables. Note the difference between "is used" and "may be used".
|
||||
Please investigate and fix.
|
||||
Problematic file(s) and their linenumbers:
|
||||
nsFrame.cpp: 3536
|
||||
###
|
||||
|
||||
--- gfx/src/gtk/nsFontMetricsUtils.cpp.old 2005-03-24 07:27:33.000000000 +0100
|
||||
+++ gfx/src/gtk/nsFontMetricsUtils.cpp 2005-03-24 07:28:26.000000000 +0100
|
||||
@@ -75,6 +75,7 @@ NS_FontMetricsGetHints(void)
|
||||
#ifdef MOZ_ENABLE_COREXFONTS
|
||||
return nsFontMetricsGTK::GetHints();
|
||||
#endif
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
nsresult
|
||||
@@ -95,6 +96,7 @@ NS_FontMetricsFamilyExists(nsIDeviceCont
|
||||
#ifdef MOZ_ENABLE_COREXFONTS
|
||||
return nsFontMetricsGTK::FamilyExists(aDevice, aName);
|
||||
#endif
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
#ifdef MOZ_ENABLE_XFT
|
||||
Index: intl/uconv/ucvko/nsUnicodeToJamoTTF.cpp
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/intl/uconv/ucvko/nsUnicodeToJamoTTF.cpp,v
|
||||
retrieving revision 1.10
|
||||
diff -u -p -6 -r1.10 nsUnicodeToJamoTTF.cpp
|
||||
--- intl/uconv/ucvko/nsUnicodeToJamoTTF.cpp 19 Feb 2005 07:27:54 -0000 1.10
|
||||
+++ intl/uconv/ucvko/nsUnicodeToJamoTTF.cpp 7 Jun 2005 07:21:10 -0000
|
||||
@@ -842,12 +842,13 @@ PRInt16 JamoSrchReplace (const JamoNormM
|
||||
// we don't need a separate range check here because the one in
|
||||
// for-loop is sufficient.
|
||||
for (PRInt32 i = start; i <= end - clusterLen; i++)
|
||||
{
|
||||
const JamoNormMap *match;
|
||||
JamoNormMap key;
|
||||
+ key.liga = 0;
|
||||
|
||||
// cluster array is made up of PRUint8's to save memory
|
||||
// and we have to subtract aOffset from the input before looking it up.
|
||||
key.seq[0] = aIn[i] - aOffset;
|
||||
key.seq[1] = aIn[i + 1] - aOffset;
|
||||
key.seq[2] = clusterLen == 3 ? (aIn[i + 2] - aOffset) : 0;
|
||||
Index: layout/generic/nsObjectFrame.cpp
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/layout/generic/nsObjectFrame.cpp,v
|
||||
retrieving revision 1.505
|
||||
diff -u -p -6 -r1.505 nsObjectFrame.cpp
|
||||
--- layout/generic/nsObjectFrame.cpp 6 May 2005 03:14:31 -0000 1.505
|
||||
+++ layout/generic/nsObjectFrame.cpp 7 Jun 2005 07:23:27 -0000
|
||||
@@ -1850,12 +1850,13 @@ nsObjectFrame::Paint(nsPresContext*
|
||||
// now we need to setup the correct location for printing
|
||||
nsresult rv;
|
||||
nsPluginWindow window;
|
||||
nsPoint origin;
|
||||
float t2p;
|
||||
window.window = nsnull;
|
||||
+ window.ws_info = nsnull;
|
||||
|
||||
// prepare embedded mode printing struct
|
||||
nsPluginPrint npprint;
|
||||
npprint.mode = nsPluginMode_Embedded;
|
||||
|
||||
// we need to find out if we are windowless or not
|
||||
Index: docshell/base/nsWebShell.cpp
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/docshell/base/nsWebShell.cpp,v
|
||||
retrieving revision 1.656.2.1
|
||||
diff -u -p -6 -r1.656.2.1 nsWebShell.cpp
|
||||
--- docshell/base/nsWebShell.cpp 16 Sep 2005 19:11:52 -0000 1.656.2.1
|
||||
+++ docshell/base/nsWebShell.cpp 22 Sep 2005 06:30:30 -0000
|
||||
@@ -556,12 +556,13 @@ nsWebShell::OnLinkClickSync(nsIContent *
|
||||
// XXX TODO Should be similar to the HTML IMG ALT attribute handling
|
||||
// in NS 4.x
|
||||
default:
|
||||
NS_ABORT_IF_FALSE(0,"unexpected link verb");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
+ return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnOverLink(nsIContent* aContent,
|
||||
nsIURI* aURI,
|
||||
const PRUnichar* aTargetSpec)
|
||||
Index: layout/generic/nsFrame.cpp
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/layout/generic/nsFrame.cpp,v
|
||||
retrieving revision 3.574.2.4
|
||||
diff -u -p -6 -r3.574.2.4 nsFrame.cpp
|
||||
--- layout/generic/nsFrame.cpp 20 Sep 2005 06:32:09 -0000 3.574.2.4
|
||||
+++ layout/generic/nsFrame.cpp 22 Sep 2005 06:31:42 -0000
|
||||
@@ -3528,13 +3528,13 @@ nsresult
|
||||
nsFrame::PeekOffsetParagraph(nsPresContext* aPresContext,
|
||||
nsPeekOffsetStruct *aPos)
|
||||
{
|
||||
#ifdef DEBUG_paragraph
|
||||
printf("Selecting paragraph\n");
|
||||
#endif
|
||||
- nsIFrame* blockFrame;
|
||||
+ nsIFrame* blockFrame = NULL;
|
||||
nsCOMPtr<nsILineIterator> iter (getter_AddRefs(GetBlockFrameAndLineIter(this, &blockFrame)));
|
||||
if (!blockFrame || !iter)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
PRInt32 thisLine;
|
||||
nsresult result = iter->FindLineContaining(this, &thisLine);
|
@ -1,70 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Copyright (c) 2001 SuSE GmbH Nuernberg, Germany. All rights reserved.
|
||||
# 2002-2003 SuSE Linux AG, Nuernberg, Germany
|
||||
# 2005 SUSE Linux Products GmbH, Nuernberg, Germany
|
||||
#
|
||||
|
||||
# check if we are started as root
|
||||
# only one of UID and USER must be set correctly
|
||||
if test "$UID" != 0 -a "$USER" != root; then
|
||||
echo "You must be root to start $0."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PREFIX="%PROGDIR"
|
||||
MOZ_APP="%APPNAME"
|
||||
|
||||
get_arch ()
|
||||
{
|
||||
file "$1" | sed -n 's/.*: ELF [^,]*, \([^,]*\),.*/\1/p'
|
||||
}
|
||||
|
||||
mozilla_arch=`get_arch $PREFIX/$MOZ_APP-bin`
|
||||
mozilla_lib=`file $PREFIX/$MOZ_APP-bin | awk '{ print $3 }'`
|
||||
|
||||
JAVA_CHECK_PATH="/usr/lib /usr/java"
|
||||
JAVA_ORDER="mozilla ns7 ns610 [Ss]un IBM BEA"
|
||||
case $mozilla_lib in
|
||||
64-bit)
|
||||
LIB=lib64
|
||||
;;
|
||||
*)
|
||||
LIB=lib
|
||||
;;
|
||||
esac
|
||||
|
||||
find_java ()
|
||||
{
|
||||
TMP=$(find $JAVA_CHECK_PATH -name "$1" -type f)
|
||||
for i in $TMP; do
|
||||
if [ "`get_arch $i`" = "$mozilla_arch" ]; then
|
||||
PLUGIN="$PLUGIN $i"
|
||||
fi
|
||||
done
|
||||
TMP=""
|
||||
}
|
||||
|
||||
# JAVA
|
||||
if [ ! -L $PREFIX/plugins/libjavaplugin_oji.so ] ||
|
||||
[ ! -f $PREFIX/plugins/libjavaplugin_oji.so ] ; then # link is here and valid
|
||||
PLUGIN=""
|
||||
find_java *javaplugin_oji.so
|
||||
find_java *javaplugin_ojigcc3.so # IBMJava
|
||||
if [ "$PLUGIN" ]; then
|
||||
for i in $PLUGIN; do
|
||||
if [[ $i == *mozilla* ]] || [[ $i == *gcc3* ]] || [[ $i == *ns7/* ]]; then
|
||||
TMP=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [ "$TMP" ]; then
|
||||
PLUGIN=$TMP
|
||||
ln -sf $PLUGIN $PREFIX/plugins/libjavaplugin_oji.so
|
||||
echo "-> added Java2 plugin ($PLUGIN)"
|
||||
else
|
||||
echo "-> Java2: no change (no suitable JRE available)"
|
||||
fi
|
||||
else
|
||||
echo "-> Java2: no change (existing link is valid)"
|
||||
fi
|
File diff suppressed because one or more lines are too long
@ -15,8 +15,7 @@
|
||||
<DT><H3 ID="rdf:#$HNakM2">openSUSE</H3>
|
||||
<DL><p>
|
||||
<DT><A HREF="http://www.opensuse.org/" ICON="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACS3LlfreXK/5Lcuf+E2LD/W8uW/1vLlv9by5b/ac+e/5Lcuf+f4MH/1vLk//////////////////////////9fJbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8yvnv/dtOn/+P27f///////////yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/ac+e//H69v8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/0DChP+E2LD/kty5/5Lcuf9206f/Mr57/yW6c/+f4MH/Jbpz/yW6c/8lunP/Jbpz/yW6c/8yvnv/dtOn/9by5P/W8uT/n+DB/3bTp/9pz57/kty5/9by5P+t5cr/hNiw/yW6c/8lunP/Jbpz/zK+e/+S3Ln/8fr2/63lyv9Nxo3/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/W8uW/+P27f8lunP/Jbpz/yW6c/+S3Ln/uunT/0DChP8lunP/Mr57/5/gwf/I7dz/yO3c/5Lcuf8lunP/Jbpz/yW6c/9AwoT/Jbpz/yW6c/8lunP/QMKE/yW6c/8lunP/Jbpz/63lyv9by5b/Jbpz/yW6c/9206f/n+DB/yW6c/8lunP/ac+e/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/0DChP+t5cr/Jbpz/yW6c/8lunP/Jbpz/8jt3P8lunP/Jbpz/63lyv8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/9by5b/kty5/yW6c/9pz57/yO3c/0DChP/I7dz/Jbpz/yW6c//x+vb/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/8jt3P8lunP/Jbpz/1vLlv8yvnv/reXK/yW6c/9206f//////yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/9Nxo3/uunT/2nPnv9206f/uunT/03Gjf8lunP/4/bt//////8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/zK+e/9206f/ac+e/zK+e/8yvnv/reXK////////////Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/0DChP+S3Ln/8fr2/////////////////63lyv9Nxo3/Jbpz/yW6c/8lunP/Jbpz/yW6c/9by5b/kty5/9by5P////////////////////////////////////9fW8uW/1vLlv9206f/n+DB/8jt3P////////////////////////////////////////////////////9fgAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAEAAA==" LAST_CHARSET="UTF-8" ID="rdf:#$n8c6+1">openSUSE</A>
|
||||
<DT><A HREF="http://software.opensuse.org/" ICON="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACS3LlfreXK/5Lcuf+E2LD/W8uW/1vLlv9by5b/ac+e/5Lcuf+f4MH/1vLk//////////////////////////9fJbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8yvnv/dtOn/+P27f///////////yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/ac+e//H69v8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/0DChP+E2LD/kty5/5Lcuf9206f/Mr57/yW6c/+f4MH/Jbpz/yW6c/8lunP/Jbpz/yW6c/8yvnv/dtOn/9by5P/W8uT/n+DB/3bTp/9pz57/kty5/9by5P+t5cr/hNiw/yW6c/8lunP/Jbpz/zK+e/+S3Ln/8fr2/63lyv9Nxo3/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/W8uW/+P27f8lunP/Jbpz/yW6c/+S3Ln/uunT/0DChP8lunP/Mr57/5/gwf/I7dz/yO3c/5Lcuf8lunP/Jbpz/yW6c/9AwoT/Jbpz/yW6c/8lunP/QMKE/yW6c/8lunP/Jbpz/63lyv9by5b/Jbpz/yW6c/9206f/n+DB/yW6c/8lunP/ac+e/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/0DChP+t5cr/Jbpz/yW6c/8lunP/Jbpz/8jt3P8lunP/Jbpz/63lyv8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/9by5b/kty5/yW6c/9pz57/yO3c/0DChP/I7dz/Jbpz/yW6c//x+vb/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/8jt3P8lunP/Jbpz/1vLlv8yvnv/reXK/yW6c/9206f//////yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/9Nxo3/uunT/2nPnv9206f/uunT/03Gjf8lunP/4/bt//////8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/zK+e/9206f/ac+e/zK+e/8yvnv/reXK////////////Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/0DChP+S3Ln/8fr2/////////////////63lyv9Nxo3/Jbpz/yW6c/8lunP/Jbpz/yW6c/9by5b/kty5/9by5P////////////////////////////////////9fW8uW/1vLlv9206f/n+DB/8jt3P////////////////////////////////////////////////////9fgAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAEAAA==" LAST_CHARSET="UTF-8" ID="rdf:#$n8c6+3">openSUSE Download</A>
|
||||
<DT><A HREF="http://software.opensuse.org/search?baseproject=openSUSE:10.3" ICON="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACS3LlfreXK/5Lcuf+E2LD/W8uW/1vLlv9by5b/ac+e/5Lcuf+f4MH/1vLk//////////////////////////9fJbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8yvnv/dtOn/+P27f///////////yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/ac+e//H69v8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/0DChP+E2LD/kty5/5Lcuf9206f/Mr57/yW6c/+f4MH/Jbpz/yW6c/8lunP/Jbpz/yW6c/8yvnv/dtOn/9by5P/W8uT/n+DB/3bTp/9pz57/kty5/9by5P+t5cr/hNiw/yW6c/8lunP/Jbpz/zK+e/+S3Ln/8fr2/63lyv9Nxo3/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/W8uW/+P27f8lunP/Jbpz/yW6c/+S3Ln/uunT/0DChP8lunP/Mr57/5/gwf/I7dz/yO3c/5Lcuf8lunP/Jbpz/yW6c/9AwoT/Jbpz/yW6c/8lunP/QMKE/yW6c/8lunP/Jbpz/63lyv9by5b/Jbpz/yW6c/9206f/n+DB/yW6c/8lunP/ac+e/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/0DChP+t5cr/Jbpz/yW6c/8lunP/Jbpz/8jt3P8lunP/Jbpz/63lyv8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/9by5b/kty5/yW6c/9pz57/yO3c/0DChP/I7dz/Jbpz/yW6c//x+vb/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/8jt3P8lunP/Jbpz/1vLlv8yvnv/reXK/yW6c/9206f//////yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/9Nxo3/uunT/2nPnv9206f/uunT/03Gjf8lunP/4/bt//////8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/zK+e/9206f/ac+e/zK+e/8yvnv/reXK////////////Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/0DChP+S3Ln/8fr2/////////////////63lyv9Nxo3/Jbpz/yW6c/8lunP/Jbpz/yW6c/9by5b/kty5/9by5P////////////////////////////////////9fW8uW/1vLlv9206f/n+DB/8jt3P////////////////////////////////////////////////////9fgAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAEAAA==" LAST_CHARSET="UTF-8" ID="rdf:#$n8c6+2">openSUSE.org Online Software Repositories</A>
|
||||
<DT><A HREF="http://software.opensuse.org/" ICON="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACS3LlfreXK/5Lcuf+E2LD/W8uW/1vLlv9by5b/ac+e/5Lcuf+f4MH/1vLk//////////////////////////9fJbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8yvnv/dtOn/+P27f///////////yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/ac+e//H69v8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/0DChP+E2LD/kty5/5Lcuf9206f/Mr57/yW6c/+f4MH/Jbpz/yW6c/8lunP/Jbpz/yW6c/8yvnv/dtOn/9by5P/W8uT/n+DB/3bTp/9pz57/kty5/9by5P+t5cr/hNiw/yW6c/8lunP/Jbpz/zK+e/+S3Ln/8fr2/63lyv9Nxo3/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/W8uW/+P27f8lunP/Jbpz/yW6c/+S3Ln/uunT/0DChP8lunP/Mr57/5/gwf/I7dz/yO3c/5Lcuf8lunP/Jbpz/yW6c/9AwoT/Jbpz/yW6c/8lunP/QMKE/yW6c/8lunP/Jbpz/63lyv9by5b/Jbpz/yW6c/9206f/n+DB/yW6c/8lunP/ac+e/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/0DChP+t5cr/Jbpz/yW6c/8lunP/Jbpz/8jt3P8lunP/Jbpz/63lyv8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/9by5b/kty5/yW6c/9pz57/yO3c/0DChP/I7dz/Jbpz/yW6c//x+vb/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/8jt3P8lunP/Jbpz/1vLlv8yvnv/reXK/yW6c/9206f//////yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/9Nxo3/uunT/2nPnv9206f/uunT/03Gjf8lunP/4/bt//////8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/zK+e/9206f/ac+e/zK+e/8yvnv/reXK////////////Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/yW6c/8lunP/Jbpz/0DChP+S3Ln/8fr2/////////////////63lyv9Nxo3/Jbpz/yW6c/8lunP/Jbpz/yW6c/9by5b/kty5/9by5P////////////////////////////////////9fW8uW/1vLlv9206f/n+DB/8jt3P////////////////////////////////////////////////////9fgAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAEAAA==" LAST_CHARSET="UTF-8" ID="rdf:#$n8c6+2">openSUSE Download</A>
|
||||
<DT><A HREF="http://news.opensuse.org/?feed=rss2" FEEDURL="http://news.opensuse.org/?feed=rss2" ID="rdf:#$Gjr951">openSUSE News</A>
|
||||
<DT><A HREF="http://www.novell.com/linux/" ICON="data:image/x-icon;base64,AAABAAIAICAQAAEABADoAgAAJgAAABAQEAABAAQAKAEAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAFgIAABcDAwACAgIAAAAD/AAD/AAAA//8A/wAAAP8A/wX//wAF////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8oAAAAEAAAACAAAAABAAQAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAA////AAAAgAAAgAAAAICAAIAAAICAAICAgIAAgMDAwMCAgICAAAD/AAD/AAAA//8A/wAA//8A/////wD/AAAA////////////////////+f//mZ////+Z//+Zn///+Zn//5mf//+Zmf//mZ//+ZmZ//+Zn/+ZmZn//5mf+ZmZmf//mZ+ZmfmZ//+ZmZmf+Zn//5mZmf/5mf//mZmf//mZ//+Zmf//+Zn//5mf///5mf//mf////////////////////9BgP/7///H8//7x+PH88fDx+PHg8fDxwPHg8YDxwPEI8YDwGPEI8DjwGPB48Djw+PB48fjw+PP/8fj///P/w==" LAST_CHARSET="ISO-8859-1" ID="rdf:#$NNakM2">Novell / Linux</A>
|
||||
<DT><A HREF="http://www.novell.com/coolsolutions/slp/" ICON="data:image/x-icon;base64,AAABAAIAICAQAAEABADoAgAAJgAAABAQEAABAAQAKAEAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAFgIAABcDAwACAgIAAAAD/AAD/AAAA//8A/wAAAP8A/wX//wAF////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8oAAAAEAAAACAAAAABAAQAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAA////AAAAgAAAgAAAAICAAIAAAICAAICAgIAAgMDAwMCAgICAAAD/AAD/AAAA//8A/wAA//8A/////wD/AAAA////////////////////+f//mZ////+Z//+Zn///+Zn//5mf//+Zmf//mZ//+ZmZ//+Zn/+ZmZn//5mf+ZmZmf//mZ+ZmfmZ//+ZmZmf+Zn//5mZmf/5mf//mZmf//mZ//+Zmf//+Zn//5mf///5mf//mf////////////////////9BgP/7///H8//7x+PH88fDx+PHg8fDxwPHg8YDxwPEI8YDwGPEI8DjwGPB48Djw+PB48fjw+PP/8fj///P/w==" LAST_CHARSET="ISO-8859-1" ID="rdf:#$ONakM2">SUSE Linux Cool Solutions</A>
|
||||
|
@ -1,30 +0,0 @@
|
||||
Index: modules/libpref/src/init/all.js
|
||||
===================================================================
|
||||
--- modules/libpref/src/init/all.js.orig
|
||||
+++ modules/libpref/src/init/all.js
|
||||
@@ -2251,8 +2251,10 @@ pref("print.postscript.print_command", "
|
||||
pref("print.postscript.nativefont.ar", "");
|
||||
pref("print.postscript.nativefont.el", "");
|
||||
pref("print.postscript.nativefont.he", "");
|
||||
-pref("print.postscript.nativefont.ja", "");
|
||||
-pref("print.postscript.nativefont.ko", "");
|
||||
+pref("print.postscript.nativefont.ja", "UTF-8");
|
||||
+pref("print.postscript.nativefont.ja", "Ryumin-Light-UniJIS-UTF8-H");
|
||||
+pref("print.postscript.nativefont.ko", "UTF-8");
|
||||
+pref("print.postscript.nativefont.ko", "Baekmuk-Gulim-UniKS-UTF8-H");
|
||||
pref("print.postscript.nativefont.th", "");
|
||||
pref("print.postscript.nativefont.tr", "");
|
||||
pref("print.postscript.nativefont.x-baltic", "");
|
||||
@@ -2261,8 +2263,10 @@ pref("print.postscript.nativefont.x-cyri
|
||||
pref("print.postscript.nativefont.x-unicode", "");
|
||||
pref("print.postscript.nativefont.x-user-def", "");
|
||||
pref("print.postscript.nativefont.x-western", "");
|
||||
-pref("print.postscript.nativefont.zh-CN", "");
|
||||
-pref("print.postscript.nativefont.zh-TW", "");
|
||||
+pref("print.postscript.nativefont.zh-CN", "UTF-8");
|
||||
+pref("print.postscript.nativefont.zh-CN", "GB-Song-Medium-UniGB-UTF8-H");
|
||||
+pref("print.postscript.nativefont.zh-TW", "UTF-8");
|
||||
+pref("print.postscript.nativefont.zh-TW", "B5-Song-Medium-UniCNS-UTF8-H");
|
||||
pref("print.postscript.nativefont.zh-HK", "");
|
||||
|
||||
# XP_UNIX
|
6079
configure.patch
6079
configure.patch
File diff suppressed because it is too large
Load Diff
858
cups-paper.patch
858
cups-paper.patch
@ -1,858 +0,0 @@
|
||||
From: Wolfgang Rosenauer <stark@suse.de>, Arne John Glenstrup <panic@itu.dk>
|
||||
Subject: get paper sizes from CUPS
|
||||
References:
|
||||
https://bugzilla.novell.com/show_bug.cgi?id=65482
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=324060
|
||||
|
||||
|
||||
================================================================================
|
||||
--- gfx/src/gtk/nsDeviceContextSpecG.cpp
|
||||
+++ gfx/src/gtk/nsDeviceContextSpecG.cpp
|
||||
@@ -66,6 +66,7 @@
|
||||
#ifdef USE_POSTSCRIPT
|
||||
#include "nsPSPrinters.h"
|
||||
#include "nsPaperPS.h" /* Paper size list */
|
||||
+#include "nsPaperFactoryPS.h" /* Paper size list factory */
|
||||
#endif /* USE_POSTSCRIPT */
|
||||
|
||||
/* Ensure that the result is always equal to either PR_TRUE or PR_FALSE */
|
||||
@@ -1210,34 +1211,38 @@
|
||||
#ifdef SET_PRINTER_FEATURES_VIA_PREFS
|
||||
printerFeatures.SetCanChangePaperSize(PR_TRUE);
|
||||
#endif /* SET_PRINTER_FEATURES_VIA_PREFS */
|
||||
- nsXPIDLCString papername;
|
||||
- if (NS_SUCCEEDED(CopyPrinterCharPref(pPrefs, "postscript", printerName, "paper_size", getter_Copies(papername)))) {
|
||||
- nsPaperSizePS paper;
|
||||
-
|
||||
- if (paper.Find(papername)) {
|
||||
- DO_PR_DEBUG_LOG(("setting default paper size to '%s' (%g mm/%g mm)\n",
|
||||
- paper.Name(), paper.Width_mm(), paper.Height_mm()));
|
||||
- aPrintSettings->SetPaperSizeUnit(paper.IsMetric() ?
|
||||
- (int)nsIPrintSettings::kPaperSizeMillimeters :
|
||||
- (int)nsIPrintSettings::kPaperSizeInches);
|
||||
- aPrintSettings->SetPaperWidth(paper.Width_mm());
|
||||
- aPrintSettings->SetPaperHeight(paper.Height_mm());
|
||||
- aPrintSettings->SetPaperName(NS_ConvertASCIItoUCS2(paper.Name()).get());
|
||||
- }
|
||||
- else {
|
||||
- DO_PR_DEBUG_LOG(("Unknown paper size '%s' given.\n", papername.get()));
|
||||
+ {
|
||||
+ nsIPaperSizePS* paper;
|
||||
+ nsresult rv;
|
||||
+ rv = nsPaperFactoryPS::CreatePaper
|
||||
+ (fullPrinterName.get(), printerName.get(), paper);
|
||||
+ if (NS_FAILED(rv)) return rv;
|
||||
+ paper->FindDefault();
|
||||
+
|
||||
+ nsXPIDLCString papername;
|
||||
+ if (NS_SUCCEEDED(CopyPrinterCharPref(pPrefs, "postscript", fullPrinterName, "print_paper_name", getter_Copies(papername)))) {
|
||||
+ if (!paper->Find(papername)) {
|
||||
+ DO_PR_DEBUG_LOG(("Unknown paper size '%s' given.\n", papername.get()));
|
||||
+ }
|
||||
}
|
||||
+ DO_PR_DEBUG_LOG(("setting default paper size to '%s' (%g mm/%g mm)\n",
|
||||
+ paper->Name(), paper->Width_mm(), paper->Height_mm()));
|
||||
+ aPrintSettings->SetPaperSizeUnit(nsIPrintSettings::kPaperSizeMillimeters);
|
||||
+ aPrintSettings->SetPaperWidth(paper->Width_mm());
|
||||
+ aPrintSettings->SetPaperHeight(paper->Height_mm());
|
||||
+ aPrintSettings->SetPaperName(NS_ConvertASCIItoUTF16(paper->Name()).get());
|
||||
#ifdef SET_PRINTER_FEATURES_VIA_PREFS
|
||||
- paper.First();
|
||||
+ paper->First();
|
||||
int count = 0;
|
||||
- while (!paper.AtEnd())
|
||||
+ while (!paper->AtEnd())
|
||||
{
|
||||
- printerFeatures.SetPaperRecord(count++, paper.Name(),
|
||||
- (int)paper.Width_mm(), (int)paper.Height_mm(), !paper.IsMetric());
|
||||
- paper.Next();
|
||||
+ printerFeatures.SetPaperRecord(count++, paper->Name(),
|
||||
+ (int)paper->Width_mm(), (int)paper->Height_mm(), !paper->IsMetric());
|
||||
+ paper->Next();
|
||||
}
|
||||
printerFeatures.SetNumPaperSizeRecords(count);
|
||||
#endif /* SET_PRINTER_FEATURES_VIA_PREFS */
|
||||
+ delete(paper);
|
||||
}
|
||||
|
||||
PRBool hasSpoolerCmd = (nsPSPrinterList::kTypePS ==
|
||||
--- gfx/src/ps/nsPrintJobPS.cpp
|
||||
+++ gfx/src/ps/nsPrintJobPS.cpp
|
||||
@@ -364,6 +364,10 @@
|
||||
const char *slash = strchr(printerName, '/');
|
||||
mPrinterName = slash ? slash + 1 : printerName;
|
||||
mJobTitle.SetIsVoid(PR_TRUE);
|
||||
+ /* Paper name */
|
||||
+ const char* paperName = nsnull;
|
||||
+ aSpec->GetPaperName(&paperName);
|
||||
+ mPaperName = paperName;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -445,6 +449,11 @@
|
||||
mNumCopies.get(),
|
||||
dest->num_options,
|
||||
&dest->options);
|
||||
+ if (!mPaperName.IsEmpty())
|
||||
+ dest->num_options = (mCups.mCupsAddOption)("media",
|
||||
+ mPaperName.get(),
|
||||
+ dest->num_options,
|
||||
+ &dest->options);
|
||||
const char *title = mJobTitle.IsVoid() ?
|
||||
"Untitled Document" : mJobTitle.get();
|
||||
result = (mCups.mCupsPrintFile)(printer.CStringAt(0)->get(),
|
||||
--- gfx/src/ps/nsPrintJobPS.h
|
||||
+++ gfx/src/ps/nsPrintJobPS.h
|
||||
@@ -179,6 +179,7 @@
|
||||
nsCUPSShim mCups;
|
||||
nsCString mPrinterName;
|
||||
nsCString mNumCopies;
|
||||
+ nsCString mPaperName;
|
||||
nsCString mJobTitle; // IsVoid() if no title
|
||||
};
|
||||
#endif /* VMS */
|
||||
--- gfx/src/psshared/Makefile.in
|
||||
+++ gfx/src/psshared/Makefile.in
|
||||
@@ -57,13 +57,16 @@
|
||||
|
||||
EXPORTS = nsCUPSShim.h \
|
||||
nsPaperPS.h \
|
||||
+ nsIPaperPS.h \
|
||||
nsPSPrinters.h\
|
||||
psSharedCore.h \
|
||||
+ nsPaperFactoryPS.h \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS = nsCUPSShim.cpp \
|
||||
nsPaperPS.cpp \
|
||||
nsPSPrinters.cpp \
|
||||
+ nsPaperFactoryPS.cpp \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DSO_LDOPTS = \
|
||||
--- gfx/src/psshared/nsCUPSShim.cpp
|
||||
+++ gfx/src/psshared/nsCUPSShim.cpp
|
||||
@@ -45,13 +45,18 @@
|
||||
// List of symbols to find in libcups. Must match symAddr[] defined in Init().
|
||||
// Making this an array of arrays instead of pointers allows storing the
|
||||
// whole thing in read-only memory.
|
||||
-static const char gSymName[][sizeof("cupsPrintFile")] = {
|
||||
+static const char gSymName[][sizeof("ppdMarkDefaults")] = {
|
||||
{ "cupsAddOption" },
|
||||
{ "cupsFreeDests" },
|
||||
{ "cupsGetDest" },
|
||||
{ "cupsGetDests" },
|
||||
{ "cupsPrintFile" },
|
||||
{ "cupsTempFd" },
|
||||
+ { "cupsGetPPD" },
|
||||
+ { "ppdOpenFile" },
|
||||
+ { "ppdClose" },
|
||||
+ { "ppdMarkDefaults" },
|
||||
+ { "ppdIsMarked" },
|
||||
};
|
||||
static const int gSymNameCt = sizeof(gSymName) / sizeof(gSymName[0]);
|
||||
|
||||
@@ -71,6 +76,11 @@
|
||||
(void **)&mCupsGetDests,
|
||||
(void **)&mCupsPrintFile,
|
||||
(void **)&mCupsTempFd,
|
||||
+ (void **)&mCupsGetPPD,
|
||||
+ (void **)&mPpdOpenFile,
|
||||
+ (void **)&mPpdClose,
|
||||
+ (void **)&mPpdMarkDefaults,
|
||||
+ (void **)&mPpdIsMarked,
|
||||
};
|
||||
|
||||
for (int i = gSymNameCt; i--; ) {
|
||||
--- gfx/src/psshared/nsCUPSShim.h
|
||||
+++ gfx/src/psshared/nsCUPSShim.h
|
||||
@@ -62,6 +62,82 @@
|
||||
cups_option_t *options; /* Options */
|
||||
} cups_dest_t;
|
||||
|
||||
+typedef enum /**** Colorspaces ****/
|
||||
+{
|
||||
+ PPD_CS_CMYK = -4, /* CMYK colorspace */
|
||||
+ PPD_CS_CMY, /* CMY colorspace */
|
||||
+ PPD_CS_GRAY = 1, /* Grayscale colorspace */
|
||||
+ PPD_CS_RGB = 3, /* RGB colorspace */
|
||||
+ PPD_CS_RGBK, /* RGBK (K = gray) colorspace */
|
||||
+ PPD_CS_N /* DeviceN colorspace */
|
||||
+} ppd_cs_t;
|
||||
+
|
||||
+typedef struct /**** Page Sizes ****/
|
||||
+{
|
||||
+ int marked; /* Page size selected? */
|
||||
+ char name[41];
|
||||
+ /* Media size option */
|
||||
+ float width, /* Width of media in points */
|
||||
+ length, /* Length of media in points */
|
||||
+ left, /* Left printable margin in points */
|
||||
+ bottom, /* Bottom printable margin in points */
|
||||
+ right, /* Right printable margin in points */
|
||||
+ top; /* Top printable margin in points */
|
||||
+} ppd_size_t;
|
||||
+
|
||||
+typedef struct /**** Files ****/
|
||||
+{
|
||||
+ int language_level, /* Language level of device */
|
||||
+ color_device, /* 1 = color device, 0 = grayscale */
|
||||
+ variable_sizes, /* 1 = supports variable sizes, 0 = doesn't */
|
||||
+ accurate_screens, /* 1 = supports accurate screens, 0 = not */
|
||||
+ contone_only, /* 1 = continuous tone only, 0 = not */
|
||||
+ landscape, /* -90 or 90 */
|
||||
+ model_number, /* Device-specific model number */
|
||||
+ manual_copies, /* 1 = Copies done manually, 0 = hardware */
|
||||
+ throughput; /* Pages per minute */
|
||||
+ ppd_cs_t colorspace; /* Default colorspace */
|
||||
+ char *patches; /* Patch commands to be sent to printer */
|
||||
+ int num_emulations; /* Number of emulations supported */
|
||||
+ void *emulations; /* Emulations and the code to invoke them */
|
||||
+ char *jcl_begin, /* Start JCL commands */
|
||||
+ *jcl_ps, /* Enter PostScript interpreter */
|
||||
+ *jcl_end, /* End JCL commands */
|
||||
+ *lang_encoding, /* Language encoding */
|
||||
+ *lang_version, /* Language version (English, Spanish, etc.) */
|
||||
+ *modelname, /* Model name (general) */
|
||||
+ *ttrasterizer, /* Truetype rasterizer */
|
||||
+ *manufacturer, /* Manufacturer name */
|
||||
+ *product, /* Product name (from PS RIP/interpreter) */
|
||||
+ *nickname, /* Nickname (specific) */
|
||||
+ *shortnickname; /* Short version of nickname */
|
||||
+ int num_groups; /* Number of UI groups */
|
||||
+ void *groups; /* UI groups */
|
||||
+ int num_sizes; /* Number of page sizes */
|
||||
+ ppd_size_t *sizes; /* Page sizes */
|
||||
+ float custom_min[2], /* Minimum variable page size */
|
||||
+ custom_max[2], /* Maximum variable page size */
|
||||
+ custom_margins[4];/* Margins around page */
|
||||
+ int num_consts; /* Number of UI/Non-UI constraints */
|
||||
+ void *consts; /* UI/Non-UI constraints */
|
||||
+ int num_fonts; /* Number of pre-loaded fonts */
|
||||
+ char **fonts; /* Pre-loaded fonts */
|
||||
+ int num_profiles; /* Number of sRGB color profiles */
|
||||
+ void *profiles; /* sRGB color profiles */
|
||||
+ int num_filters; /* Number of filters */
|
||||
+ char **filters; /* Filter strings... */
|
||||
+
|
||||
+ /**** New in CUPS 1.1 ****/
|
||||
+ int flip_duplex; /* 1 = Flip page for back sides */
|
||||
+
|
||||
+ /**** New in CUPS 1.1.19 ****/
|
||||
+ char *protocols, /* Protocols (BCP, TBCP) string */
|
||||
+ *pcfilename; /* PCFileName string */
|
||||
+ int num_attrs, /* Number of attributes */
|
||||
+ cur_attr; /* Current attribute */
|
||||
+ void **attrs; /* Attributes */
|
||||
+} ppd_file_t;
|
||||
+
|
||||
typedef cups_dest_t* (PR_CALLBACK *CupsGetDestType)(const char *printer,
|
||||
const char *instance,
|
||||
int num_dests,
|
||||
@@ -80,6 +156,11 @@
|
||||
const char *value,
|
||||
int num_options,
|
||||
cups_option_t **options);
|
||||
+typedef const char* (PR_CALLBACK *CupsGetPPDType) (const char* name);
|
||||
+typedef ppd_file_t* (PR_CALLBACK *PPDOpenFileType) (const char* filename);
|
||||
+typedef void (PR_CALLBACK *PPDCloseType) (ppd_file_t* ppd);
|
||||
+typedef void (PR_CALLBACK *PPDMarkDefaultsType) (ppd_file_t* ppd);
|
||||
+typedef int (PR_CALLBACK *PPDIsMarkedType) (ppd_file_t* ppd, const char* pname, const char* pname_clear);
|
||||
|
||||
struct PRLibrary;
|
||||
|
||||
@@ -113,6 +194,11 @@
|
||||
CupsGetDestsType mCupsGetDests;
|
||||
CupsPrintFileType mCupsPrintFile;
|
||||
CupsTempFdType mCupsTempFd;
|
||||
+ CupsGetPPDType mCupsGetPPD;
|
||||
+ PPDOpenFileType mPpdOpenFile;
|
||||
+ PPDCloseType mPpdClose;
|
||||
+ PPDMarkDefaultsType mPpdMarkDefaults;
|
||||
+ PPDIsMarkedType mPpdIsMarked;
|
||||
|
||||
private:
|
||||
PRLibrary *mCupsLib;
|
||||
--- gfx/src/psshared/nsIPaperPS.h
|
||||
+++ gfx/src/psshared/nsIPaperPS.h
|
||||
@@ -0,0 +1,102 @@
|
||||
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
+/* ex: set tabstop=8 softtabstop=4 shiftwidth=4 expandtab: */
|
||||
+/* ***** BEGIN LICENSE BLOCK *****
|
||||
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
+ *
|
||||
+ * The contents of this file are subject to the Mozilla Public License Version
|
||||
+ * 1.1 (the "License"); you may not use this file except in compliance with
|
||||
+ * the License. You may obtain a copy of the License at
|
||||
+ * http://www.mozilla.org/MPL/
|
||||
+ *
|
||||
+ * Software distributed under the License is distributed on an "AS IS" basis,
|
||||
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
+ * for the specific language governing rights and limitations under the
|
||||
+ * License.
|
||||
+ *
|
||||
+ * Contributor(s):
|
||||
+ * Arne John Glenstrup <panic@itu.dk>
|
||||
+ *
|
||||
+ * Alternatively, the contents of this file may be used under the terms of
|
||||
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
+ * in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
+ * of those above. If you wish to allow use of your version of this file only
|
||||
+ * under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
+ * use your version of this file under the terms of the MPL, indicate your
|
||||
+ * decision by deleting the provisions above and replace them with the notice
|
||||
+ * and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
+ * the provisions above, a recipient may use your version of this file under
|
||||
+ * the terms of any one of the MPL, the GPL or the LGPL.
|
||||
+ *
|
||||
+ * ***** END LICENSE BLOCK ***** */
|
||||
+
|
||||
+
|
||||
+#ifndef _NSIPAPERPS_H_
|
||||
+#define _NSIPAPERPS_H_
|
||||
+
|
||||
+#include "prtypes.h"
|
||||
+#include "psSharedCore.h"
|
||||
+
|
||||
+class nsIPaperSizePS {
|
||||
+ public:
|
||||
+ /** ---------------------------------------------------
|
||||
+ * Virtual destructor.
|
||||
+ */
|
||||
+ virtual ~nsIPaperSizePS();
|
||||
+
|
||||
+ /* Allow the paper factory to create instances */
|
||||
+ friend class nsPaperFactoryPS;
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * @return PR_TRUE if the cursor points past the last item.
|
||||
+ */
|
||||
+ virtual PRBool AtEnd() = 0;
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * Position the cursor at the beginning of the paper size list.
|
||||
+ * @return VOID
|
||||
+ */
|
||||
+ virtual void First() = 0;
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * Advance the cursor to the next item.
|
||||
+ * @return VOID
|
||||
+ */
|
||||
+ virtual void Next() = 0;
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * Point the cursor to the entry with the given paper name.
|
||||
+ * @return PR_TRUE if pointing to a valid entry.
|
||||
+ */
|
||||
+ virtual PRBool Find(const char *aName) = 0;
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * Point the cursor to a default entry if available.
|
||||
+ * Otherwise it's equivalent to First().
|
||||
+ * @return PR_TRUE if pointing to a valid entry.
|
||||
+ */
|
||||
+ virtual PRBool FindDefault() = 0;
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * @return a pointer to the name of the current paper size
|
||||
+ */
|
||||
+ virtual const char *Name() = 0;
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * @return the width of the page in millimeters
|
||||
+ */
|
||||
+ virtual float Width_mm() = 0;
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * @return the height of the page in millimeters
|
||||
+ */
|
||||
+ virtual float Height_mm() = 0;
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * @return PR_TRUE if the paper should be presented to
|
||||
+ * the user in metric units.
|
||||
+ */
|
||||
+ virtual PRBool IsMetric() { return PR_TRUE; };
|
||||
+};
|
||||
+
|
||||
+#endif /* _NSIPAPERPS_H_ */
|
||||
--- gfx/src/psshared/nsPSPrinters.h
|
||||
+++ gfx/src/psshared/nsPSPrinters.h
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "prtypes.h"
|
||||
#include "nsCUPSShim.h"
|
||||
#include "psSharedCore.h"
|
||||
+#include "nsCOMPtr.h"
|
||||
|
||||
class nsIPrefService;
|
||||
class nsIPrefBranch;
|
||||
--- gfx/src/psshared/nsPaperFactoryPS.cpp
|
||||
+++ gfx/src/psshared/nsPaperFactoryPS.cpp
|
||||
@@ -0,0 +1,65 @@
|
||||
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
+/* ex: set tabstop=8 softtabstop=4 shiftwidth=4 expandtab: */
|
||||
+/* ***** BEGIN LICENSE BLOCK *****
|
||||
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
+ *
|
||||
+ * The contents of this file are subject to the Mozilla Public License Version
|
||||
+ * 1.1 (the "License"); you may not use this file except in compliance with
|
||||
+ * the License. You may obtain a copy of the License at
|
||||
+ * http://www.mozilla.org/MPL/
|
||||
+ *
|
||||
+ * Software distributed under the License is distributed on an "AS IS" basis,
|
||||
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
+ * for the specific language governing rights and limitations under the
|
||||
+ * License.
|
||||
+ *
|
||||
+ * The Original Code is mozilla.org code.
|
||||
+ *
|
||||
+ * The Initial Developer of the Original Code is
|
||||
+ * Kenneth Herron <kherron@fastmail.us>.
|
||||
+ * Portions created by the Initial Developer are Copyright (C) 2004
|
||||
+ * the Initial Developer. All Rights Reserved.
|
||||
+ *
|
||||
+ * Contributor(s):
|
||||
+ * Arne John Glenstrup <panic@itu.dk>
|
||||
+ *
|
||||
+ * Alternatively, the contents of this file may be used under the terms of
|
||||
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
+ * in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
+ * of those above. If you wish to allow use of your version of this file only
|
||||
+ * under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
+ * use your version of this file under the terms of the MPL, indicate your
|
||||
+ * decision by deleting the provisions above and replace them with the notice
|
||||
+ * and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
+ * the provisions above, a recipient may use your version of this file under
|
||||
+ * the terms of any one of the MPL, the GPL or the LGPL.
|
||||
+ *
|
||||
+ * ***** END LICENSE BLOCK ***** */
|
||||
+
|
||||
+
|
||||
+#include "nsDebug.h"
|
||||
+#include "nsPaperFactoryPS.h"
|
||||
+#include "nsIPaperPS.h"
|
||||
+#include "nsPaperPS.h"
|
||||
+#include "nsPSPrinters.h"
|
||||
+
|
||||
+nsresult
|
||||
+nsPaperFactoryPS::CreatePaper(const char* fullPrinterName,
|
||||
+ const char* printerName,
|
||||
+ nsIPaperSizePS* &aPaper)
|
||||
+{
|
||||
+ nsIPaperSizePS *newPZ;
|
||||
+
|
||||
+ if (nsPSPrinterList::kTypeCUPS == nsPSPrinterList::GetPrinterType
|
||||
+ (nsDependentCString(fullPrinterName)))
|
||||
+ newPZ = new nsPaperSizeCUPS(fullPrinterName, printerName);
|
||||
+ else
|
||||
+ newPZ = new nsPaperSizePS();
|
||||
+
|
||||
+ if (!newPZ)
|
||||
+ return NS_ERROR_OUT_OF_MEMORY;
|
||||
+
|
||||
+ aPaper = newPZ;
|
||||
+ return NS_OK;
|
||||
+}
|
||||
--- gfx/src/psshared/nsPaperFactoryPS.h
|
||||
+++ gfx/src/psshared/nsPaperFactoryPS.h
|
||||
@@ -0,0 +1,64 @@
|
||||
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
+/* ex: set tabstop=8 softtabstop=4 shiftwidth=4 expandtab: */
|
||||
+/* ***** BEGIN LICENSE BLOCK *****
|
||||
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
+ *
|
||||
+ * The contents of this file are subject to the Mozilla Public License Version
|
||||
+ * 1.1 (the "License"); you may not use this file except in compliance with
|
||||
+ * the License. You may obtain a copy of the License at
|
||||
+ * http://www.mozilla.org/MPL/
|
||||
+ *
|
||||
+ * Software distributed under the License is distributed on an "AS IS" basis,
|
||||
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
+ * for the specific language governing rights and limitations under the
|
||||
+ * License.
|
||||
+ *
|
||||
+ * Contributor(s):
|
||||
+ * Arne John Glenstrup <panic@itu.dk>
|
||||
+ *
|
||||
+ * Alternatively, the contents of this file may be used under the terms of
|
||||
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
+ * in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
+ * of those above. If you wish to allow use of your version of this file only
|
||||
+ * under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
+ * use your version of this file under the terms of the MPL, indicate your
|
||||
+ * decision by deleting the provisions above and replace them with the notice
|
||||
+ * and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
+ * the provisions above, a recipient may use your version of this file under
|
||||
+ * the terms of any one of the MPL, the GPL or the LGPL.
|
||||
+ *
|
||||
+ * ***** END LICENSE BLOCK ***** */
|
||||
+
|
||||
+#ifndef nsPaperFactoryPS_h__
|
||||
+#define nsPaperFactoryPS_h__
|
||||
+
|
||||
+#include "nscore.h"
|
||||
+#include "nsIPaperPS.h"
|
||||
+
|
||||
+/* Factory class for the paper sizes. This class determines
|
||||
+ * which paper size class should handle a request, and constructs
|
||||
+ * an object of the appropriate class.
|
||||
+ */
|
||||
+
|
||||
+class NS_PSSHARED nsPaperFactoryPS
|
||||
+{
|
||||
+public:
|
||||
+ /**
|
||||
+ * Construct a paper size object for the given device context spec.
|
||||
+ * On success, the paper size object is owned by the caller and should
|
||||
+ * be destroyed when no longer needed.
|
||||
+ *
|
||||
+ * @param fullPrinterName Fully qualified name, e.g., "CUPS/myprinter"
|
||||
+ * @param printerName Stripped name, e.g., "myprinter"
|
||||
+ * @param aPaper If NS_OK is returned, this will be filled
|
||||
+ * in with a pointer to a paper size object.
|
||||
+ * @return NS_OK or a suitable error value.
|
||||
+ */
|
||||
+ static nsresult CreatePaper(const char* fullPrinterName,
|
||||
+ const char* printerName,
|
||||
+ nsIPaperSizePS* &aPaper);
|
||||
+};
|
||||
+
|
||||
+
|
||||
+#endif /* nsPaperFactoryPS_h__ */
|
||||
--- gfx/src/psshared/nsPaperPS.cpp
|
||||
+++ gfx/src/psshared/nsPaperPS.cpp
|
||||
@@ -22,6 +22,7 @@
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
+ * Arne John Glenstrup <panic@itu.dk>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@@ -37,9 +38,25 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
-
|
||||
+#ifdef MOZ_LOGGING
|
||||
+#define FORCE_PR_LOG 1 /* Allow logging in the release build */
|
||||
+#endif /* MOZ_LOGGING */
|
||||
+#include "prlog.h"
|
||||
+
|
||||
#include "nsPaperPS.h"
|
||||
#include "plstr.h"
|
||||
+#include "nsPSPrinters.h"
|
||||
+#include <math.h>
|
||||
+
|
||||
+#ifdef PR_LOGGING
|
||||
+static PRLogModuleInfo *PaperSizePSLM = PR_NewLogModule("PaperSizePS");
|
||||
+#endif /* PR_LOGGING */
|
||||
+/* Macro to make lines shorter */
|
||||
+#define DO_PR_DEBUG_LOG(x) PR_LOG(PaperSizePSLM, PR_LOG_DEBUG, x)
|
||||
+
|
||||
+#define MM_PER_PT (25.4 / 72.0)
|
||||
+#define HALF_INCH_PT 36.0
|
||||
+#define EPSILON 0.125
|
||||
|
||||
#define COUNTOF(x) (sizeof(x) / sizeof((x)[0]))
|
||||
|
||||
@@ -57,7 +74,15 @@
|
||||
#undef SIZE_MM
|
||||
};
|
||||
|
||||
-const unsigned int nsPaperSizePS::mCount = COUNTOF(mList);
|
||||
+nsCUPSShim nsPaperSizeCUPS::mCups;
|
||||
+
|
||||
+/* ~nsIPaperSizePS() is virtual, so must implement a destructor. */
|
||||
+nsIPaperSizePS::~nsIPaperSizePS () { }
|
||||
+
|
||||
+nsPaperSizePS::nsPaperSizePS() {
|
||||
+ mCount = COUNTOF(mList);
|
||||
+ mCurrent = 0;
|
||||
+}
|
||||
|
||||
PRBool
|
||||
nsPaperSizePS::Find(const char *aName)
|
||||
@@ -70,3 +95,125 @@
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
+
|
||||
+nsPaperSizeCUPS::nsPaperSizeCUPS(const char* fullPrinterName,
|
||||
+ const char* printerName) {
|
||||
+ DO_PR_DEBUG_LOG(("nsPaperSizeCUPS::nsPaperSizeCUPS('%s', '%s')\n",
|
||||
+ fullPrinterName, printerName));
|
||||
+ /* Don't use CUPS before we are sure we have access to the PPD */
|
||||
+ mUsingCups = false;
|
||||
+ mPPD = nsnull;
|
||||
+ mCount = COUNTOF(mList);
|
||||
+ mCurrent = 0;
|
||||
+ if (!fullPrinterName || !printerName ||
|
||||
+ nsPSPrinterList::kTypeCUPS !=
|
||||
+ nsPSPrinterList::GetPrinterType(nsDependentCString(fullPrinterName)))
|
||||
+ return;
|
||||
+ if (!mCups.IsInitialized()) { mCups.Init(); }
|
||||
+ if (!mCups.IsInitialized()) {
|
||||
+ DO_PR_DEBUG_LOG(("nsPaperSizeCUPS::nsPaperSizeCUPS: CUPS unavailable\n"));
|
||||
+ return;
|
||||
+ }
|
||||
+ const char* ppdFileName = mCups.mCupsGetPPD(printerName);
|
||||
+ if (!ppdFileName) {
|
||||
+ DO_PR_DEBUG_LOG(("nsPaperSizeCUPS::nsPaperSizeCUPS: "
|
||||
+ "cannot get PPD file name for printer '%s'\n",
|
||||
+ printerName));
|
||||
+ return;
|
||||
+ }
|
||||
+ mPPD = mCups.mPpdOpenFile(ppdFileName);
|
||||
+ if (!mPPD) {
|
||||
+ DO_PR_DEBUG_LOG(("nsPaperSizeCUPS::nsPaperSizeCUPS: "
|
||||
+ "cannot open PPD file '%s'\n",
|
||||
+ ppdFileName));
|
||||
+ return;
|
||||
+ }
|
||||
+ mCount = mPPD->num_sizes;
|
||||
+ mUsingCups = true;
|
||||
+}
|
||||
+
|
||||
+nsPaperSizeCUPS::~nsPaperSizeCUPS() {
|
||||
+ if (mPPD) mCups.mPpdClose(mPPD);
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+nsPaperSizeCUPS::SkipZeroSizes() {
|
||||
+ if (!mUsingCups) return;
|
||||
+ while (mCurrent < mCount
|
||||
+ && (mPPD->sizes[mCurrent].width == 0.0f ||
|
||||
+ mPPD->sizes[mCurrent].length == 0.0f)) {
|
||||
+ mCurrent++;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+PRBool
|
||||
+nsPaperSizeCUPS::Find(const char* aName) {
|
||||
+ DO_PR_DEBUG_LOG(("nsPaperSizeCUPS::Find ('%s') ", aName));
|
||||
+ if (!mUsingCups) return nsPaperSizePS::Find(aName);
|
||||
+ for (int i = mCount; i--; ) {
|
||||
+ if (!PL_strcasecmp(aName, mPPD->sizes[i].name)) {
|
||||
+ DO_PR_DEBUG_LOG
|
||||
+ (("found paper '%s' (%gx%gmm)\n",
|
||||
+ aName,
|
||||
+ round(mPPD->sizes[i].width * MM_PER_PT),
|
||||
+ round(mPPD->sizes[i].length * MM_PER_PT)));
|
||||
+ mCurrent = i;
|
||||
+ return PR_TRUE;
|
||||
+ }
|
||||
+ }
|
||||
+ DO_PR_DEBUG_LOG(("did not find paper '%s'\n", aName));
|
||||
+ return PR_FALSE;
|
||||
+}
|
||||
+
|
||||
+PRBool
|
||||
+nsPaperSizeCUPS::FindDefault() {
|
||||
+ DO_PR_DEBUG_LOG(("nsPaperSizeCUPS::FindDefault"));
|
||||
+ if (!mUsingCups) return nsPaperSizePS::FindDefault();
|
||||
+ mCups.mPpdMarkDefaults(mPPD);
|
||||
+ for (int i = mCount; i--; ) {
|
||||
+ if (mCups.mPpdIsMarked(mPPD, "PageSize", mPPD->sizes[i].name )) {
|
||||
+ DO_PR_DEBUG_LOG
|
||||
+ (("found default paper '%s' (%gx%gmm)\n",
|
||||
+ mPPD->sizes[i].name,
|
||||
+ round(mPPD->sizes[i].width * MM_PER_PT),
|
||||
+ round(mPPD->sizes[i].length * MM_PER_PT)));
|
||||
+ mCurrent = i;
|
||||
+ return PR_TRUE;
|
||||
+ }
|
||||
+ }
|
||||
+ mCurrent = 0;
|
||||
+ DO_PR_DEBUG_LOG(("no default paper found, therefore set the first\n"));
|
||||
+ return PR_TRUE;
|
||||
+}
|
||||
+
|
||||
+const char*
|
||||
+nsPaperSizeCUPS::Name() {
|
||||
+ if (!mUsingCups) return nsPaperSizePS::Name();
|
||||
+ NS_PRECONDITION(!AtEnd(), "Invalid current item");
|
||||
+ return mPPD->sizes[mCurrent].name;
|
||||
+}
|
||||
+
|
||||
+float
|
||||
+nsPaperSizeCUPS::Width_mm() {
|
||||
+ if (!mUsingCups) return nsPaperSizePS::Width_mm();
|
||||
+ NS_PRECONDITION(!AtEnd(), "Invalid current item");
|
||||
+ return round(mPPD->sizes[mCurrent].width * MM_PER_PT);
|
||||
+}
|
||||
+
|
||||
+float
|
||||
+nsPaperSizeCUPS::Height_mm() {
|
||||
+ if (!mUsingCups) return nsPaperSizePS::Height_mm();
|
||||
+ NS_PRECONDITION(!AtEnd(), "Invalid current item");
|
||||
+ return round(mPPD->sizes[mCurrent].length * MM_PER_PT);
|
||||
+}
|
||||
+
|
||||
+PRBool
|
||||
+nsPaperSizeCUPS::IsMetric() {
|
||||
+ if (!mUsingCups) return nsPaperSizePS::IsMetric();
|
||||
+ NS_PRECONDITION(!AtEnd(), "Invalid current item");
|
||||
+ /* Educated guess: unless sizes are integral number */
|
||||
+ /* of half inches, present them to the user in metric. */
|
||||
+ return
|
||||
+ fabs(fmod(mPPD->sizes[mCurrent].width, HALF_INCH_PT)) > EPSILON ||
|
||||
+ fabs(fmod(mPPD->sizes[mCurrent].length, HALF_INCH_PT)) > EPSILON;
|
||||
+}
|
||||
--- gfx/src/psshared/nsPaperPS.h
|
||||
+++ gfx/src/psshared/nsPaperPS.h
|
||||
@@ -40,9 +40,9 @@
|
||||
#ifndef _PAPERPS_H_
|
||||
#define _PAPERPS_H_
|
||||
|
||||
-#include "prtypes.h"
|
||||
+#include "nsIPaperPS.h"
|
||||
#include "nsDebug.h"
|
||||
-#include "psSharedCore.h"
|
||||
+#include "nsCUPSShim.h"
|
||||
|
||||
struct nsPaperSizePS_ {
|
||||
const char *name;
|
||||
@@ -51,13 +51,13 @@
|
||||
PRBool isMetric; // Present to the user in metric, if possible
|
||||
};
|
||||
|
||||
-class NS_PSSHARED nsPaperSizePS {
|
||||
+class NS_PSSHARED nsPaperSizePS : public nsIPaperSizePS {
|
||||
public:
|
||||
/** ---------------------------------------------------
|
||||
* Constructor
|
||||
*/
|
||||
- nsPaperSizePS() { mCurrent = 0; }
|
||||
-
|
||||
+ nsPaperSizePS();
|
||||
+
|
||||
/** ---------------------------------------------------
|
||||
* @return PR_TRUE if the cursor points past the last item.
|
||||
*/
|
||||
@@ -85,6 +85,12 @@
|
||||
PRBool Find(const char *aName);
|
||||
|
||||
/** ---------------------------------------------------
|
||||
+ * Position the cursor at the beginning of the paper size list.
|
||||
+ * @return PR_TRUE
|
||||
+ */
|
||||
+ PRBool FindDefault() { mCurrent = 0; return PR_TRUE; }
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
* @return a pointer to the name of the current paper size
|
||||
*/
|
||||
const char *Name() {
|
||||
@@ -117,11 +123,83 @@
|
||||
return mList[mCurrent].isMetric;
|
||||
}
|
||||
|
||||
- private:
|
||||
+ protected:
|
||||
unsigned int mCurrent;
|
||||
// the class visibility should export these, but it doesn't
|
||||
static NS_PSSHARED_STATIC_MEMBER_(const nsPaperSizePS_) mList[];
|
||||
- static NS_PSSHARED_STATIC_MEMBER_(const unsigned int) mCount;
|
||||
+ unsigned int mCount;
|
||||
+};
|
||||
+
|
||||
+class NS_PSSHARED nsPaperSizeCUPS : public nsPaperSizePS {
|
||||
+ public:
|
||||
+ /** ---------------------------------------------------
|
||||
+ * Constructor for a specific CUPS printer.
|
||||
+ * @param fullPrinterName Fully qualified name, e.g., "CUPS/myprinter"
|
||||
+ * @param printerName Stripped name, e.g., "myprinter"
|
||||
+ */
|
||||
+ nsPaperSizeCUPS(const char* fullPrinterName, const char* printerName);
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * Destructor.
|
||||
+ */
|
||||
+ ~nsPaperSizeCUPS();
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * Position the cursor at the beginning of the paper size list.
|
||||
+ * @return VOID
|
||||
+ */
|
||||
+ void First() {
|
||||
+ nsPaperSizePS::First();
|
||||
+ SkipZeroSizes();
|
||||
+ }
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * Advance the cursor to the next item.
|
||||
+ * @return VOID
|
||||
+ */
|
||||
+ void Next() {
|
||||
+ nsPaperSizePS::Next();
|
||||
+ SkipZeroSizes();
|
||||
+ }
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * Point the cursor to the entry with the given paper name.
|
||||
+ * @return PR_TRUE if pointing to a valid entry.
|
||||
+ */
|
||||
+ PRBool Find(const char *aName);
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * Point the cursor to the CUPS default entry for paper size.
|
||||
+ * @return PR_TRUE if pointing to a valid entry.
|
||||
+ */
|
||||
+ PRBool FindDefault();
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * @return a pointer to the name of the current paper size
|
||||
+ */
|
||||
+ const char *Name();
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * @return the width of the page in millimeters
|
||||
+ */
|
||||
+ float Width_mm();
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * @return the height of the page in millimeters
|
||||
+ */
|
||||
+ float Height_mm();
|
||||
+
|
||||
+ /** ---------------------------------------------------
|
||||
+ * @return PR_TRUE if the paper should be presented to
|
||||
+ * the user in metric units.
|
||||
+ */
|
||||
+ PRBool IsMetric();
|
||||
+
|
||||
+ private:
|
||||
+ void SkipZeroSizes();
|
||||
+ PRBool mUsingCups;
|
||||
+ static NS_PSSHARED_STATIC_MEMBER_(nsCUPSShim) mCups;
|
||||
+ ppd_file_t* mPPD;
|
||||
};
|
||||
|
||||
#endif
|
||||
--- gfx/src/xlib/nsDeviceContextSpecXlib.cpp
|
||||
+++ gfx/src/xlib/nsDeviceContextSpecXlib.cpp
|
||||
@@ -1212,7 +1212,11 @@
|
||||
#endif /* SET_PRINTER_FEATURES_VIA_PREFS */
|
||||
nsXPIDLCString papername;
|
||||
if (NS_SUCCEEDED(CopyPrinterCharPref(pPrefs, "postscript", printerName, "paper_size", getter_Copies(papername)))) {
|
||||
- nsPaperSizePS paper;
|
||||
+ nsIPaperSizePS* paper;
|
||||
+ nsresult rv;
|
||||
+ rv = nsPaperFactoryPS::CreatePaper
|
||||
+ (fullPrinterName.get(), printerName.get(), paper);
|
||||
+ if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (paper.Find(papername)) {
|
||||
DO_PR_DEBUG_LOG(("setting default paper size to '%s' (%g mm/%g mm)\n",
|
||||
@@ -1238,6 +1242,7 @@
|
||||
}
|
||||
printerFeatures.SetNumPaperSizeRecords(count);
|
||||
#endif /* SET_PRINTER_FEATURES_VIA_PREFS */
|
||||
+ delete(paper);
|
||||
}
|
||||
|
||||
PRBool hasSpoolerCmd = (nsPSPrinterList::kTypePS ==
|
588
dbus.patch
588
dbus.patch
@ -1,588 +0,0 @@
|
||||
Index: configure.in
|
||||
================================================================================
|
||||
--- browser/installer/unix/packages-static
|
||||
+++ browser/installer/unix/packages-static
|
||||
@@ -341,6 +341,7 @@
|
||||
;
|
||||
bin/components/libnkgnomevfs.so
|
||||
bin/components/libauth.so
|
||||
+bin/components/libdbusservice.so
|
||||
|
||||
; [Additional Developer Tools]
|
||||
[adt]
|
||||
--- config/autoconf.mk.in
|
||||
+++ config/autoconf.mk.in
|
||||
@@ -458,6 +458,12 @@
|
||||
MOZ_GTK2_CFLAGS = @MOZ_GTK2_CFLAGS@
|
||||
MOZ_GTK2_LIBS = @MOZ_GTK2_LIBS@
|
||||
|
||||
+MOZ_DBUS_GLIB_CFLAGS = @MOZ_DBUS_GLIB_CFLAGS@
|
||||
+MOZ_DBUS_GLIB_LIBS = @MOZ_DBUS_GLIB_LIBS@
|
||||
+
|
||||
+MOZ_GTHREAD_CFLAGS = @MOZ_GTHREAD_CFLAGS@
|
||||
+MOZ_GTHREAD_LIBS = @MOZ_GTHREAD_LIBS@
|
||||
+
|
||||
MOZ_XLIB_CFLAGS = @MOZ_XLIB_CFLAGS@
|
||||
MOZ_XLIB_LDFLAGS = @MOZ_XLIB_LDFLAGS@
|
||||
|
||||
--- configure.in
|
||||
+++ configure.in
|
||||
@@ -4776,6 +4776,33 @@
|
||||
AC_SUBST(MOZ_GNOMEUI_LIBS)
|
||||
|
||||
dnl ========================================================
|
||||
+dnl = dbus support
|
||||
+dnl ========================================================
|
||||
+
|
||||
+if test "$MOZ_ENABLE_GTK2"
|
||||
+then
|
||||
+ MOZ_ARG_ENABLE_BOOL(dbus,
|
||||
+ [ --enable-dbus Enable dbus support (default: disabled) ],
|
||||
+ MOZ_ENABLE_DBUS=1,
|
||||
+ MOZ_ENABLE_DBUS=)
|
||||
+
|
||||
+ if test "$MOZ_ENABLE_DBUS"
|
||||
+ then
|
||||
+ PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1)
|
||||
+ PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
|
||||
+ fi
|
||||
+
|
||||
+ if test "$MOZ_ENABLE_DBUS"; then
|
||||
+ AC_DEFINE(MOZ_ENABLE_DBUS)
|
||||
+ fi
|
||||
+fi
|
||||
+AC_SUBST(MOZ_ENABLE_DBUS)
|
||||
+AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
|
||||
+AC_SUBST(MOZ_DBUS_GLIB_LIBS)
|
||||
+AC_SUBST(MOZ_GTHREAD_CFLAGS)
|
||||
+AC_SUBST(MOZ_GTHREAD_LIBS)
|
||||
+
|
||||
+dnl ========================================================
|
||||
dnl = Setting MOZ_EXTRA_X11CONVERTERS turns on additional
|
||||
dnl = converters in intl/uconv that are used only by X11 gfx
|
||||
dnl = implementations. By default, it's undefined so that
|
||||
@@ -5128,6 +5155,13 @@
|
||||
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
|
||||
fi
|
||||
|
||||
+if test -z "$MOZ_ENABLE_DBUS" && test `echo "$MOZ_EXTENSIONS" | grep -c dbus` -ne 0; then
|
||||
+ if test -n "$MOZ_X11"; then
|
||||
+ AC_MSG_WARN([Cannot build dbus without required libraries. Removing dbus from MOZ_EXTENSIONS.])
|
||||
+ fi
|
||||
+ MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|dbus||'`
|
||||
+fi
|
||||
+
|
||||
if test -z "$MOZ_JSDEBUGGER" && test `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
|
||||
AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
|
||||
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
|
||||
--- extensions/dbus/Makefile.in
|
||||
+++ extensions/dbus/Makefile.in
|
||||
@@ -0,0 +1,70 @@
|
||||
+# ###### BEGIN LICENSE BLOCK ######
|
||||
+# Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
+#
|
||||
+#
|
||||
+# The contents of this file are subject to the Mozilla Public
|
||||
+# License Version 1.1 (the "License"); you may not use this file
|
||||
+# except in compliance with the License. You may obtain a copy of
|
||||
+# the License at http://www.mozilla.org/MPL/
|
||||
+#
|
||||
+# Software distributed under the License is distributed on an "AS
|
||||
+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
+# implied. See the License for the specific language governing
|
||||
+# rights and limitations under the License.
|
||||
+#
|
||||
+# The Original Code is Novell code.
|
||||
+#
|
||||
+# The Initial Developer of the Original Code is Novell, Inc.
|
||||
+#
|
||||
+# Original Author: Robert O'Callahan (rocallahan@novell.com)
|
||||
+#
|
||||
+# Contributor(s):
|
||||
+#
|
||||
+# Alternatively, the contents of this file may be used under the terms of
|
||||
+# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
+# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
+# of those above. If you wish to allow use of your version of this file only
|
||||
+# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
+# use your version of this file under the terms of the NPL, indicate your
|
||||
+# decision by deleting the provisions above and replace them with the notice
|
||||
+# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
+# the provisions above, a recipient may use your version of this file under
|
||||
+# the terms of any one of the NPL, the GPL or the LGPL.
|
||||
+#
|
||||
+# ###### END LICENSE BLOCK ######
|
||||
+
|
||||
+DEPTH = ../..
|
||||
+topsrcdir = @top_srcdir@
|
||||
+srcdir = @srcdir@
|
||||
+VPATH = @srcdir@
|
||||
+
|
||||
+include $(DEPTH)/config/autoconf.mk
|
||||
+
|
||||
+MODULE = dbus
|
||||
+LIBRARY_NAME = dbusservice
|
||||
+GRE_MODULE = 1
|
||||
+#EXPORT_LIBRARY = 1
|
||||
+IS_COMPONENT = 1
|
||||
+FORCE_SHARED_LIB = 1
|
||||
+
|
||||
+REQUIRES = xpcom \
|
||||
+ string \
|
||||
+ necko \
|
||||
+ embedcomponents \
|
||||
+ $(NULL)
|
||||
+
|
||||
+EXTRA_DSO_LDOPTS = $(XPCOM_GLUE_LDOPTS) \
|
||||
+ $(NSPR_LIBS) \
|
||||
+ $(MOZ_DBUS_GLIB_LIBS) \
|
||||
+ $(MOZ_GTHREAD_LIBS) \
|
||||
+ $(NULL)
|
||||
+
|
||||
+CPPSRCS = \
|
||||
+ nsDBusModule.cpp \
|
||||
+ $(NULL)
|
||||
+
|
||||
+include $(topsrcdir)/config/rules.mk
|
||||
+
|
||||
+CXXFLAGS += $(TK_CFLAGS) $(MOZ_DBUS_GLIB_CFLAGS) $(MOZ_GTHREAD_CFLAGS)
|
||||
+CXXFLAGS := $(subst -pedantic,,$(CXXFLAGS))
|
||||
Index: config/system-headers
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/config/system-headers,v
|
||||
retrieving revision 3.4.4.3
|
||||
diff -u -r3.4.4.3 system-headers
|
||||
--- config/system-headers 18 Dec 2006 23:48:58 -0000 3.4.4.3
|
||||
+++ config/system-headers 13 Nov 2007 23:04:10 -0000
|
||||
@@ -141,6 +141,9 @@
|
||||
curses.h
|
||||
cxxabi.h
|
||||
DateTimeUtils.h
|
||||
+dbus/dbus.h
|
||||
+dbus/dbus-glib.h
|
||||
+dbus/dbus-glib-lowlevel.h
|
||||
ddeml.h
|
||||
Debug.h
|
||||
dem.h
|
||||
--- extensions/dbus/nsDBusModule.cpp.none 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ extensions/dbus/nsDBusModule.cpp 2008-01-15 17:09:51.000000000 +0100
|
||||
@@ -0,0 +1,418 @@
|
||||
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
+/* vim:expandtab:shiftwidth=4:tabstop=4:
|
||||
+ */
|
||||
+/* ***** BEGIN LICENSE BLOCK *****
|
||||
+ * Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
+ *
|
||||
+ *
|
||||
+ * The contents of this file are subject to the Mozilla Public
|
||||
+ * License Version 1.1 (the "License"); you may not use this file
|
||||
+ * except in compliance with the License. You may obtain a copy of
|
||||
+ * the License at http://www.mozilla.org/MPL/
|
||||
+ *
|
||||
+ * Software distributed under the License is distributed on an "AS
|
||||
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
+ * implied. See the License for the specific language governing
|
||||
+ * rights and limitations under the License.
|
||||
+ *
|
||||
+ * The Original Code is Novell code.
|
||||
+ *
|
||||
+ * The Initial Developer of the Original Code is Novell, Inc.
|
||||
+ *
|
||||
+ * Original Author: Robert O'Callahan (rocallahan@novell.com)
|
||||
+ *
|
||||
+ * Contributor(s):
|
||||
+ *
|
||||
+ * Alternatively, the contents of this file may be used under the terms of
|
||||
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
+ * in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
+ * of those above. If you wish to allow use of your version of this file only
|
||||
+ * under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
+ * use your version of this file under the terms of the NPL, indicate your
|
||||
+ * decision by deleting the provisions above and replace them with the notice
|
||||
+ * and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
+ * the provisions above, a recipient may use your version of this file under
|
||||
+ * the terms of any one of the NPL, the GPL or the LGPL.
|
||||
+ *
|
||||
+ * ***** END LICENSE BLOCK ***** */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+#define DBUS_API_SUBJECT_TO_CHANGE
|
||||
+
|
||||
+#include <glib.h>
|
||||
+#include <dbus/dbus.h>
|
||||
+#include <dbus/dbus-glib-lowlevel.h>
|
||||
+#include <dbus/dbus-glib.h>
|
||||
+
|
||||
+#include "nsIObserverService.h"
|
||||
+#include "nsIObserver.h"
|
||||
+#include "nsIIOService.h"
|
||||
+#include "nsWeakReference.h"
|
||||
+#include "nsIPrefBranch2.h"
|
||||
+#include "nsIPrefService.h"
|
||||
+#include "nsServiceManagerUtils.h"
|
||||
+#include "nsNetCID.h"
|
||||
+#include "nsCRT.h"
|
||||
+#include "nsICategoryManager.h"
|
||||
+#include "nsIGenericFactory.h"
|
||||
+#include "nsIAppStartupNotifier.h"
|
||||
+#include "nsITimer.h"
|
||||
+#include "nsComponentManagerUtils.h"
|
||||
+
|
||||
+#include "nsStringAPI.h"
|
||||
+
|
||||
+// Define NetworkManager API constants. This avoids a dependency on
|
||||
+// NetworkManager-devel.
|
||||
+#define NM_DBUS_SERVICE "org.freedesktop.NetworkManager"
|
||||
+#define NM_DBUS_PATH "/org/freedesktop/NetworkManager"
|
||||
+#define NM_DBUS_INTERFACE "org.freedesktop.NetworkManager"
|
||||
+#define NM_DBUS_SIGNAL_STATE_CHANGE "StateChange"
|
||||
+typedef enum NMState
|
||||
+{
|
||||
+ NM_STATE_UNKNOWN = 0,
|
||||
+ NM_STATE_ASLEEP,
|
||||
+ NM_STATE_CONNECTING,
|
||||
+ NM_STATE_CONNECTED,
|
||||
+ NM_STATE_DISCONNECTED
|
||||
+} NMState;
|
||||
+
|
||||
+#define NS_DBUS_CONTRACTID "@mozilla.org/dbus;1"
|
||||
+#define NS_DBUS_CLASSNAME "DBus Interface"
|
||||
+#define NS_DBUS_CID \
|
||||
+ { 0x85899443, \
|
||||
+ 0x2842, \
|
||||
+ 0x4cc4, \
|
||||
+ { 0x87, 0x0c, 0x7a, 0x6f, 0x22, 0xb0, 0xaa, 0x11 } \
|
||||
+ }
|
||||
+
|
||||
+/**
|
||||
+ * The nsDBusService component interfaces with DBUS to communicate with daemons
|
||||
+ * in systems supporting DBUS. It links dynamically to the DBUS libraries so
|
||||
+ * will not load on systems without those libraries ... but that's harmless.
|
||||
+ *
|
||||
+ * Currently the only daemon we communicate with is NetworkManager. We listen
|
||||
+ * for NetworkManager state changes; we set nsIOService's offline status to
|
||||
+ * FALSE when NetworkManager reports NM_STATE_CONNECTED, and to TRUE otherwise.
|
||||
+ * We also solicit the current status from NetworkManager when this component
|
||||
+ * gets loaded. In addition to setting IOService, we also set the
|
||||
+ * "browser.offline" preference (because Firefox treats that preference as
|
||||
+ * authoritative). We have to wait until prefs have been loaded before setting
|
||||
+ * "browser.offline".
|
||||
+ *
|
||||
+ * In the future we could extend this class to talk to other daemons.
|
||||
+ *
|
||||
+ * Currently all communication is asynchronous. This isn't hard to implement
|
||||
+ * and avoids blocking our main thread.
|
||||
+ */
|
||||
+class nsDBusService : public nsIObserver,
|
||||
+ public nsSupportsWeakReference
|
||||
+{
|
||||
+public:
|
||||
+ NS_DECL_ISUPPORTS
|
||||
+ NS_DECL_NSIOBSERVER
|
||||
+
|
||||
+ nsDBusService();
|
||||
+ virtual ~nsDBusService();
|
||||
+
|
||||
+ nsresult Init();
|
||||
+
|
||||
+ /**
|
||||
+ * This gets called when NetworkManager sends us a StateChange signal,
|
||||
+ * or when we receive a reply to our inquiry.
|
||||
+ * The message contains the current NMState.
|
||||
+ */
|
||||
+ void UpdateNetworkStatus(DBusMessage* message);
|
||||
+
|
||||
+ /**
|
||||
+ * Handle a message.
|
||||
+ * @return PR_TRUE to indicate that the message has been handled
|
||||
+ */
|
||||
+ PRBool HandleMessage(DBusMessage* message);
|
||||
+
|
||||
+ void DoTimerCallback(nsITimer* aTimer);
|
||||
+
|
||||
+private:
|
||||
+ /**
|
||||
+ * Try to connect to the dbus service.
|
||||
+ */
|
||||
+ nsresult ConnectToDBus();
|
||||
+ /**
|
||||
+ * Ask NetworkManager to send us the current status.
|
||||
+ */
|
||||
+ void RequestNetworkStatus();
|
||||
+ /**
|
||||
+ * Update Gecko networking settings based on information we have received.
|
||||
+ */
|
||||
+ void SetGeckoNetworkStatus();
|
||||
+ /**
|
||||
+ * DBUS has disconnected. Hopefull it will restart; we need to restore
|
||||
+ * our connection.
|
||||
+ */
|
||||
+ void HandleDBusDisconnect();
|
||||
+
|
||||
+ DBusConnection* mConnection;
|
||||
+ nsCOMPtr<nsITimer> mReconnectTimer;
|
||||
+
|
||||
+ /**
|
||||
+ * Set to PR_TRUE after we have received at least one status indication
|
||||
+ * from NetworkManager.
|
||||
+ */
|
||||
+ PRPackedBool mGotNetworkStatus;
|
||||
+ /**
|
||||
+ * When mGotNetworkStatus is PR_TRUE, this contains the status indicated
|
||||
+ * by NetworkManager.
|
||||
+ */
|
||||
+ PRPackedBool mNetworkOnline;
|
||||
+ /**
|
||||
+ * Set to PR_TRUE after prefs have been loaded.
|
||||
+ */
|
||||
+ PRPackedBool mPrefsLoaded;
|
||||
+};
|
||||
+
|
||||
+NS_IMPL_ISUPPORTS2(nsDBusService, nsIObserver, nsISupportsWeakReference)
|
||||
+
|
||||
+nsDBusService::nsDBusService() {
|
||||
+ mConnection = nsnull;
|
||||
+ mGotNetworkStatus = PR_FALSE;
|
||||
+ mPrefsLoaded = PR_FALSE;
|
||||
+}
|
||||
+
|
||||
+nsDBusService::~nsDBusService() {
|
||||
+ if (mConnection) {
|
||||
+ dbus_connection_unref(mConnection);
|
||||
+ }
|
||||
+ if (mReconnectTimer) {
|
||||
+ mReconnectTimer->Cancel();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void nsDBusService::SetGeckoNetworkStatus() {
|
||||
+ // Don't set Gecko status until after prefs have been loaded. When
|
||||
+ // prefs are loaded, we'll get called again.
|
||||
+ if (!mPrefsLoaded || !mGotNetworkStatus)
|
||||
+ return;
|
||||
+
|
||||
+ // ignore set requests if special pref is set
|
||||
+ nsCOMPtr<nsIPrefBranch2> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
||||
+ if (prefs) {
|
||||
+ PRBool ignore = PR_FALSE;
|
||||
+ prefs->GetBoolPref("browser.ignoreNM", &ignore);
|
||||
+ if (!ignore) {
|
||||
+ prefs->SetBoolPref("browser.offline", !mNetworkOnline);
|
||||
+ nsCOMPtr<nsIIOService> ios(do_GetService(NS_IOSERVICE_CONTRACTID));
|
||||
+ if (ios) {
|
||||
+ ios->SetOffline(!mNetworkOnline);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void nsDBusService::UpdateNetworkStatus(DBusMessage* msg) {
|
||||
+ PRInt32 result;
|
||||
+ if (dbus_message_get_args(msg, NULL, DBUS_TYPE_UINT32, &result,
|
||||
+ DBUS_TYPE_INVALID)) {
|
||||
+ mGotNetworkStatus = PR_TRUE;
|
||||
+ mNetworkOnline = result == NM_STATE_CONNECTED;
|
||||
+ SetGeckoNetworkStatus();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void NetworkStatusNotify(DBusPendingCall *pending,
|
||||
+ void* user_data) {
|
||||
+ DBusMessage* msg = dbus_pending_call_steal_reply(pending);
|
||||
+ if (!msg)
|
||||
+ return;
|
||||
+ if (dbus_message_get_type(msg) == DBUS_MESSAGE_TYPE_METHOD_RETURN) {
|
||||
+ NS_STATIC_CAST(nsDBusService*, user_data)->UpdateNetworkStatus(msg);
|
||||
+ }
|
||||
+ dbus_message_unref(msg);
|
||||
+}
|
||||
+
|
||||
+void nsDBusService::RequestNetworkStatus() {
|
||||
+ DBusMessage* msg =
|
||||
+ dbus_message_new_method_call(NM_DBUS_SERVICE, NM_DBUS_PATH,
|
||||
+ NM_DBUS_INTERFACE, "state");
|
||||
+ if (!msg)
|
||||
+ return;
|
||||
+
|
||||
+ DBusPendingCall* reply;
|
||||
+ if (dbus_connection_send_with_reply(mConnection, msg, &reply, -1)) {
|
||||
+ dbus_pending_call_set_notify(reply, NetworkStatusNotify, this, NULL);
|
||||
+ dbus_pending_call_unref(reply);
|
||||
+ }
|
||||
+ dbus_message_unref(msg);
|
||||
+}
|
||||
+
|
||||
+void nsDBusService::DoTimerCallback(nsITimer *aTimer) {
|
||||
+ if (aTimer == mReconnectTimer.get()) {
|
||||
+ nsresult rv = ConnectToDBus();
|
||||
+ if (NS_SUCCEEDED(rv)) {
|
||||
+ mReconnectTimer->Cancel();
|
||||
+ mReconnectTimer = nsnull;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void TimerCallback(nsITimer *aTimer, void *aClosure) {
|
||||
+ NS_STATIC_CAST(nsDBusService*, aClosure)->DoTimerCallback(aTimer);
|
||||
+}
|
||||
+
|
||||
+void nsDBusService::HandleDBusDisconnect() {
|
||||
+ if (mConnection) {
|
||||
+ dbus_connection_unref(mConnection);
|
||||
+ mConnection = nsnull;
|
||||
+ }
|
||||
+
|
||||
+ nsresult rv;
|
||||
+ mReconnectTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
|
||||
+ if (NS_FAILED(rv))
|
||||
+ return;
|
||||
+ rv = mReconnectTimer->InitWithFuncCallback(TimerCallback, this,
|
||||
+ 5000, nsITimer::TYPE_REPEATING_SLACK);
|
||||
+ if (NS_FAILED(rv)) {
|
||||
+ mReconnectTimer = nsnull;
|
||||
+ return;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+PRBool nsDBusService::HandleMessage(DBusMessage* message) {
|
||||
+ if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL,
|
||||
+ "Disconnected")) {
|
||||
+ HandleDBusDisconnect();
|
||||
+ return PR_FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (dbus_message_is_signal(message, NM_DBUS_INTERFACE,
|
||||
+ NM_DBUS_SIGNAL_STATE_CHANGE)) {
|
||||
+ UpdateNetworkStatus(message);
|
||||
+ return PR_TRUE;
|
||||
+ }
|
||||
+
|
||||
+ return PR_FALSE;
|
||||
+}
|
||||
+
|
||||
+NS_IMETHODIMP nsDBusService::Observe(nsISupports *aSubject,
|
||||
+ const char *aTopic,
|
||||
+ const PRUnichar *aData) {
|
||||
+ if (!aTopic)
|
||||
+ return NS_OK;
|
||||
+
|
||||
+ if (!nsCRT::strcmp(aTopic, NS_PREFSERVICE_READ_TOPIC_ID)) {
|
||||
+ mPrefsLoaded = PR_TRUE;
|
||||
+ SetGeckoNetworkStatus();
|
||||
+ }
|
||||
+ return NS_OK;
|
||||
+}
|
||||
+
|
||||
+static DBusHandlerResult dbus_filter(DBusConnection* connection,
|
||||
+ DBusMessage* message,
|
||||
+ void* user_data) {
|
||||
+ return NS_STATIC_CAST(nsDBusService*, user_data)->HandleMessage(message)
|
||||
+ ? DBUS_HANDLER_RESULT_HANDLED : DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
+}
|
||||
+
|
||||
+nsresult nsDBusService::ConnectToDBus() {
|
||||
+ DBusError error;
|
||||
+ dbus_error_init(&error);
|
||||
+
|
||||
+ mConnection = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
|
||||
+ if (!mConnection) {
|
||||
+ dbus_error_free(&error);
|
||||
+ return NS_ERROR_FAILURE;
|
||||
+ }
|
||||
+
|
||||
+ dbus_connection_set_exit_on_disconnect(mConnection, PR_FALSE);
|
||||
+ dbus_connection_setup_with_g_main(mConnection, NULL);
|
||||
+
|
||||
+ if (!dbus_connection_add_filter(mConnection, dbus_filter, this, NULL)) {
|
||||
+ dbus_error_free(&error);
|
||||
+ return NS_ERROR_FAILURE;
|
||||
+ }
|
||||
+
|
||||
+ dbus_bus_add_match(mConnection,
|
||||
+ "type='signal',"
|
||||
+ "interface='" NM_DBUS_INTERFACE "',"
|
||||
+ "sender='" NM_DBUS_SERVICE "',"
|
||||
+ "path='" NM_DBUS_PATH "'", &error);
|
||||
+ if (dbus_error_is_set(&error)) {
|
||||
+ dbus_error_free(&error);
|
||||
+ return NS_ERROR_FAILURE;
|
||||
+ }
|
||||
+
|
||||
+ RequestNetworkStatus();
|
||||
+
|
||||
+ dbus_error_free(&error);
|
||||
+
|
||||
+ return NS_OK;
|
||||
+}
|
||||
+
|
||||
+nsresult nsDBusService::Init() {
|
||||
+ nsresult rv;
|
||||
+ nsCOMPtr<nsIObserverService> observerService =
|
||||
+ do_GetService("@mozilla.org/observer-service;1", &rv);
|
||||
+ if (NS_FAILED(rv))
|
||||
+ return rv;
|
||||
+
|
||||
+ rv = observerService->AddObserver(this, NS_PREFSERVICE_READ_TOPIC_ID,
|
||||
+ PR_FALSE);
|
||||
+ if (NS_FAILED(rv))
|
||||
+ return rv;
|
||||
+
|
||||
+ if (!g_thread_supported ())
|
||||
+ g_thread_init (NULL);
|
||||
+ dbus_g_thread_init();
|
||||
+
|
||||
+ return ConnectToDBus();
|
||||
+}
|
||||
+
|
||||
+NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDBusService, Init)
|
||||
+
|
||||
+static NS_METHOD
|
||||
+RegisterDBus(nsIComponentManager *aCompMgr,
|
||||
+ nsIFile *aPath,
|
||||
+ const char *registryLocation,
|
||||
+ const char *componentType,
|
||||
+ const nsModuleComponentInfo *info) {
|
||||
+ nsresult rv;
|
||||
+
|
||||
+ nsCOMPtr<nsICategoryManager>
|
||||
+ categoryManager(do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv));
|
||||
+ if (NS_SUCCEEDED(rv)) {
|
||||
+ rv = categoryManager->AddCategoryEntry(APPSTARTUP_CATEGORY,
|
||||
+ "DBus Module",
|
||||
+ NS_DBUS_CONTRACTID,
|
||||
+ PR_TRUE, PR_TRUE, nsnull);
|
||||
+ }
|
||||
+
|
||||
+ return rv;
|
||||
+}
|
||||
+
|
||||
+static NS_METHOD
|
||||
+UnRegisterDBus(nsIComponentManager *aCompMgr,
|
||||
+ nsIFile *aPath,
|
||||
+ const char *registryLocation,
|
||||
+ const nsModuleComponentInfo *info) {
|
||||
+ nsresult rv;
|
||||
+ nsCOMPtr<nsICategoryManager>
|
||||
+ categoryManager(do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv));
|
||||
+ if (NS_SUCCEEDED(rv)) {
|
||||
+ rv = categoryManager->DeleteCategoryEntry(APPSTARTUP_CATEGORY,
|
||||
+ "DBus Module",
|
||||
+ PR_TRUE);
|
||||
+ }
|
||||
+ return rv;
|
||||
+}
|
||||
+
|
||||
+static const nsModuleComponentInfo components[] = {
|
||||
+ { NS_DBUS_CLASSNAME,
|
||||
+ NS_DBUS_CID,
|
||||
+ NS_DBUS_CONTRACTID,
|
||||
+ nsDBusServiceConstructor,
|
||||
+ RegisterDBus,
|
||||
+ UnRegisterDBus,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+NS_IMPL_NSGETMODULE(nsDBusModule, components)
|
@ -1,25 +0,0 @@
|
||||
References:
|
||||
https://bugzilla.novell.com/show_bug.cgi?id=217374
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=356370
|
||||
|
||||
Index: toolkit/mozapps/extensions/src/nsExtensionManager.js.in
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in,v
|
||||
retrieving revision 1.144.2.60
|
||||
diff -u -p -6 -r1.144.2.60 nsExtensionManager.js.in
|
||||
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in 17 Sep 2006 22:17:11 -0000 1.144.2.60
|
||||
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in 29 Nov 2006 07:54:31 -0000
|
||||
@@ -4008,12 +4008,13 @@ ExtensionManager.prototype = {
|
||||
for (var i = 0; i < allItems.length; ++i) {
|
||||
var item = allItems[i];
|
||||
|
||||
// An item entry is valid only if it is not disabled, not about to
|
||||
// be disabled, and not about to be uninstalled.
|
||||
var installLocation = this.getInstallLocation(item.id);
|
||||
+ if (! installLocation) continue;
|
||||
if (installLocation.name in StartupCache.entries &&
|
||||
item.id in StartupCache.entries[installLocation.name] &&
|
||||
StartupCache.entries[installLocation.name][item.id]) {
|
||||
var op = StartupCache.entries[installLocation.name][item.id].op;
|
||||
if (op == OP_NEEDS_INSTALL || op == OP_NEEDS_UPGRADE ||
|
||||
op == OP_NEEDS_UNINSTALL || op == OP_NEEDS_DISABLE)
|
23
find-external-requires.sh
Normal file
23
find-external-requires.sh
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Finds requirements provided outside of the current file set
|
||||
|
||||
filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
|
||||
|
||||
provides=`echo "$filelist" | /usr/lib/rpm/find-provides`
|
||||
|
||||
{
|
||||
for f in $filelist ; do
|
||||
echo $f | /usr/lib/rpm/find-requires | while read req ; do
|
||||
found=0
|
||||
for p in $provides ; do
|
||||
if [ "$req" = "$p" ]; then
|
||||
found=1
|
||||
fi
|
||||
done
|
||||
if [ "$found" = "0" ]; then
|
||||
echo $req
|
||||
fi
|
||||
done
|
||||
done
|
||||
} | sort -u
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e693cdb4c76e985979bb913b5591bbd7406625ee1bb7fe6c373009ee502e7c77
|
||||
size 37730299
|
3
firefox-2.9.94-source.tar.bz2
Normal file
3
firefox-2.9.94-source.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2098d8bad5e527fd631d94d35c91b655222c06c09f0ad73349ed96867b37766e
|
||||
size 36208890
|
@ -1,13 +0,0 @@
|
||||
Index: mozilla/toolkit/components/printing/content/printdialog.js
|
||||
===================================================================
|
||||
--- mozilla.orig/toolkit/components/printing/content/printdialog.js
|
||||
+++ mozilla/toolkit/components/printing/content/printdialog.js
|
||||
@@ -93,7 +93,7 @@ function initDialog()
|
||||
gPrefService = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefService).getBranch(null);
|
||||
if (gPrefService.getBoolPref("config.lockdown.savepage")) {
|
||||
- dialog.fileRadio.setAttribute("disabled", "true");
|
||||
+ dialog.fileCheck.setAttribute("disabled", "true");
|
||||
}
|
||||
if (gPrefService.getBoolPref("config.lockdown.printing")) {
|
||||
dialog.printButton.setAttribute("disabled", "true");
|
20
firefox-libxul-sdk.patch
Normal file
20
firefox-libxul-sdk.patch
Normal file
@ -0,0 +1,20 @@
|
||||
Index: browser/locales/Makefile.in
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/browser/locales/Makefile.in,v
|
||||
retrieving revision 1.59
|
||||
diff -u -r1.59 Makefile.in
|
||||
--- browser/locales/Makefile.in 10 Feb 2008 06:09:54 -0000 1.59
|
||||
+++ browser/locales/Makefile.in 29 Feb 2008 08:48:09 -0000
|
||||
@@ -172,9 +172,11 @@
|
||||
endif
|
||||
|
||||
libs-%:
|
||||
+ifndef LIBXUL_SDK
|
||||
@$(MAKE) -C ../../toolkit/locales libs-$*
|
||||
- @$(MAKE) -C ../../extensions/reporter/locales libs AB_CD=$* XPI_NAME=locale-$*
|
||||
@$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
|
||||
+endif
|
||||
+ @$(MAKE) -C ../../extensions/reporter/locales libs AB_CD=$* XPI_NAME=locale-$*
|
||||
@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
|
||||
ifdef MOZ_BRANDING_DIRECTORY
|
||||
@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
|
@ -1,8 +1,59 @@
|
||||
Index: browser/components/preferences/advanced.js
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/browser/components/preferences/advanced.js,v
|
||||
retrieving revision 1.27
|
||||
diff -u -p -6 -r1.27 advanced.js
|
||||
--- browser/components/preferences/advanced.js 9 Oct 2007 17:24:35 -0000 1.27
|
||||
+++ browser/components/preferences/advanced.js 28 Nov 2007 15:30:36 -0000
|
||||
@@ -241,12 +241,14 @@ var gAdvancedPane = {
|
||||
getService(Components.interfaces.nsIApplicationUpdateService);
|
||||
|
||||
var enabledPref = document.getElementById("app.update.enabled");
|
||||
var enableAppUpdate = document.getElementById("enableAppUpdate");
|
||||
|
||||
enableAppUpdate.disabled = !aus.canUpdate || enabledPref.locked;
|
||||
+ enableAppUpdate.disabled = true;
|
||||
+ enableAppUpdate.hidden = true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Enables/disables UI for "when updates are found" based on the values,
|
||||
* and "locked" states of associated preferences.
|
||||
*/
|
||||
Index: browser/base/content/baseMenuOverlay.xul
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/browser/base/content/baseMenuOverlay.xul,v
|
||||
retrieving revision 1.16
|
||||
diff -u -p -6 -r1.16 baseMenuOverlay.xul
|
||||
--- browser/base/content/baseMenuOverlay.xul 1 Apr 2007 05:22:56 -0000 1.16
|
||||
+++ browser/base/content/baseMenuOverlay.xul 29 Nov 2007 13:11:29 -0000
|
||||
@@ -94,17 +94,17 @@
|
||||
#endif
|
||||
<menuitem id="releaseNotes"
|
||||
accesskey="&helpReleaseNotes.accesskey;"
|
||||
label="&helpReleaseNotes.label;"
|
||||
oncommand="openReleaseNotes(event)"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
- <menuseparator id="updateSeparator"/>
|
||||
<menuitem id="checkForUpdates"
|
||||
accesskey="&updateCmd.accesskey;"
|
||||
label="&updateCmd.label;"
|
||||
class="menuitem-iconic"
|
||||
+ hidden="true"
|
||||
oncommand="checkForUpdates();"/>
|
||||
<menuseparator id="aboutSeparator"/>
|
||||
<menuitem id="aboutName"
|
||||
accesskey="&aboutCmd.accesskey;"
|
||||
label="&aboutCmd.label;"
|
||||
oncommand="openAboutDialog();"/>
|
||||
Index: browser/app/profile/firefox.js
|
||||
================================================================================
|
||||
--- browser/app/profile/firefox.js
|
||||
+++ browser/app/profile/firefox.js
|
||||
@@ -77,65 +77,6 @@
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/browser/app/profile/firefox.js,v
|
||||
retrieving revision 1.252
|
||||
diff -u -p -r1.252 firefox.js
|
||||
--- browser/app/profile/firefox.js 12 Jan 2008 22:22:03 -0000 1.252
|
||||
+++ browser/app/profile/firefox.js 18 Jan 2008 21:26:09 -0000
|
||||
@@ -77,66 +77,6 @@ pref("extensions.blocklist.detailsURL",
|
||||
// Dictionary download preference
|
||||
pref("browser.dictionaries.download.url", "https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/firefox/%VERSION%/dictionaries/");
|
||||
|
||||
@ -31,7 +82,7 @@ Index: browser/app/profile/firefox.js
|
||||
-pref("app.update.silent", false);
|
||||
-
|
||||
-// Update service URL:
|
||||
-pref("app.update.url", "https://aus2.mozilla.org/update/2/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/update.xml");
|
||||
-pref("app.update.url", "https://aus2.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
|
||||
-// app.update.url.manual is in branding section
|
||||
-// app.update.url.details is in branding section
|
||||
-
|
||||
@ -41,15 +92,16 @@ Index: browser/app/profile/firefox.js
|
||||
-// Interval: Time between checks for a new version (in seconds)
|
||||
-// default=1 day
|
||||
-pref("app.update.interval", 86400);
|
||||
-// Interval: Time before prompting the user to download a new version that
|
||||
-// is available (in seconds) default=1 day
|
||||
-pref("app.update.nagTimer.download", 86400);
|
||||
-// Interval: Time before prompting the user to restart to install the latest
|
||||
-// download (in seconds) default=30 minutes
|
||||
-pref("app.update.nagTimer.restart", 1800);
|
||||
-// Interval: Time before prompting the user again to restart to install the
|
||||
-// latest download (in seconds) default=1 day
|
||||
-pref("app.update.nagTimer.restart", 86400);
|
||||
-// Interval: When all registered timers should be checked (in milliseconds)
|
||||
-// default=5 seconds
|
||||
-// default=10 minutes
|
||||
-pref("app.update.timer", 600000);
|
||||
-// Give the user x seconds to react before showing the big UI. default=12 hrs
|
||||
-pref("app.update.promptWaitTime", 43200);
|
||||
-// Show the Update Checking/Ready UI when the user was idle for x seconds
|
||||
-pref("app.update.idletime", 60);
|
||||
-
|
||||
-// Whether or not we show a dialog box informing the user that the update was
|
||||
-// successfully applied. This is off in Firefox by default since we show a
|
||||
@ -68,39 +120,25 @@ Index: browser/app/profile/firefox.js
|
||||
// Symmetric (can be overridden by individual extensions) update preferences.
|
||||
// e.g.
|
||||
// extensions.{GUID}.update.enabled
|
||||
--- browser/base/content/baseMenuOverlay.xul
|
||||
+++ browser/base/content/baseMenuOverlay.xul
|
||||
@@ -76,7 +76,7 @@
|
||||
label="&helpMenu.label;"
|
||||
accesskey="&helpMenu.accesskey;">
|
||||
#endif
|
||||
- <menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();">
|
||||
+ <menupopup id="menu_HelpPopup">
|
||||
<menuitem oncommand="openHelp('firefox-help', 'chrome://browser/locale/help/help.rdf');"
|
||||
#ifdef XP_MACOSX
|
||||
label="&helpContentsMac.label;"
|
||||
@@ -102,10 +102,8 @@
|
||||
accesskey="&updateCmd.accesskey;"
|
||||
label="&updateCmd.label;"
|
||||
class="menuitem-iconic"
|
||||
- oncommand="checkForUpdates();"/>
|
||||
-#ifndef XP_MACOSX
|
||||
- <menuseparator/>
|
||||
-#endif
|
||||
+ oncommand="checkForUpdates();"
|
||||
+ hidden="true"/>
|
||||
<menuitem id="aboutName"
|
||||
accesskey="&aboutCmd.accesskey;"
|
||||
label="&aboutCmd.label;"
|
||||
--- browser/components/preferences/advanced.js
|
||||
+++ browser/components/preferences/advanced.js
|
||||
@@ -252,7 +252,8 @@
|
||||
var enabledPref = document.getElementById("app.update.enabled");
|
||||
var enableAppUpdate = document.getElementById("enableAppUpdate");
|
||||
|
||||
- enableAppUpdate.disabled = !aus.canUpdate || enabledPref.locked;
|
||||
+ enableAppUpdate.disabled = true;
|
||||
+ enableAppUpdate.hidden = true;
|
||||
},
|
||||
|
||||
/**
|
||||
Index: browser/components/safebrowsing/content/report-phishing-overlay.xul
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/browser/components/safebrowsing/content/report-phishing-overlay.xul,v
|
||||
retrieving revision 1.11
|
||||
diff -u -p -6 -r1.11 report-phishing-overlay.xul
|
||||
--- browser/components/safebrowsing/content/report-phishing-overlay.xul 26 Feb 2008 19:31:44 -0000 1.11
|
||||
+++ browser/components/safebrowsing/content/report-phishing-overlay.xul 10 Mar 2008 23:42:27 -0000
|
||||
@@ -47,13 +47,13 @@
|
||||
<!--<broadcaster id="reportPhishingErrorBroadcaster" disabled="true"/>-->
|
||||
</broadcasterset>
|
||||
<menupopup id="menu_HelpPopup">
|
||||
<menuitem id="menu_HelpPopup_reportPhishingtoolmenu"
|
||||
label="&reportPhishSiteMenu.title;..."
|
||||
accesskey="&reportPhishSiteMenu.accesskey;"
|
||||
- insertbefore="updateSeparator"
|
||||
+ insertbefore="aboutSeparator"
|
||||
observes="reportPhishingBroadcaster"
|
||||
oncommand="openUILink(safebrowsing.getReportURL('Phish'), event);"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<!-- XXX Bug 415846
|
||||
<menuitem id="menu_HelpPopup_reportPhishingErrortoolmenu"
|
||||
label="&safeb.palm.notforgery.label;..."
|
||||
|
@ -11,12 +11,10 @@ pref("font.default.x-western", "sans-serif");
|
||||
pref("font.name.monospace.x-western", "monospace");
|
||||
pref("font.name.monospace.x-unicode", "monospace");
|
||||
pref("network.negotiate-auth.gsslib", "GSSAPI");
|
||||
pref("network.proxy.type", 5);
|
||||
pref("print.print_edge_top", 14); // 1/100 of an inch
|
||||
pref("print.print_edge_left", 16); // 1/100 of an inch
|
||||
pref("print.print_edge_right", 16); // 1/100 of an inch
|
||||
pref("print.print_edge_bottom", 14); // 1/100 of an inch
|
||||
pref("startup.homepage_override_url", "resource:/browserconfig.properties");
|
||||
pref("browser.throbber.url", "resource:/browserconfig.properties");
|
||||
pref("browser.backspace_action", 2);
|
||||
pref("browser.tabs.loadFolderAndReplace", "false");
|
||||
pref("browser.tabs.loadFolderAndReplace", false);
|
||||
|
@ -1,432 +0,0 @@
|
||||
diff --git a/browser/base/content/browser-context.inc b/browser/base/content/browser-context.inc
|
||||
index 72fd054..ea364fe 100644
|
||||
--- a/browser/base/content/browser-context.inc
|
||||
+++ b/browser/base/content/browser-context.inc
|
||||
@@ -206,7 +206,8 @@
|
||||
accesskey="&saveFrameCmd.accesskey;"
|
||||
oncommand="saveDocument(gContextMenu.target.ownerDocument);"/>
|
||||
<menuseparator/>
|
||||
- <menuitem label="&viewFrameSourceCmd.label;"
|
||||
+ <menuitem id="context-frame-viewFrameSourceCmd"
|
||||
+ label="&viewFrameSourceCmd.label;"
|
||||
accesskey="&viewFrameSourceCmd.accesskey;"
|
||||
oncommand="gContextMenu.viewFrameSource();"/>
|
||||
<menuitem label="&viewFrameInfoCmd.label;"
|
||||
diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc
|
||||
index bcf9109..0cc6740 100644
|
||||
--- a/browser/base/content/browser-menubar.inc
|
||||
+++ b/browser/base/content/browser-menubar.inc
|
||||
@@ -55,9 +55,9 @@
|
||||
<menuitem id="menu_saveFrame" label="&saveFrameCmd.label;" accesskey="&saveFrameCmd.accesskey;" command="Browser:SaveFrame" hidden="true"/>
|
||||
<menuitem id="menu_sendLink" label="&sendPageCmd.label;" accesskey="&sendPageCmd.accesskey;" command="Browser:SendLink"/>
|
||||
<menuseparator/>
|
||||
- <menuitem label="&printSetupCmd.label;" accesskey="&printSetupCmd.accesskey;" command="cmd_pageSetup"/>
|
||||
+ <menuitem id="menu_printSetup" label="&printSetupCmd.label;" accesskey="&printSetupCmd.accesskey;" command="cmd_pageSetup"/>
|
||||
#ifndef XP_MACOSX
|
||||
- <menuitem label="&printPreviewCmd.label;" accesskey="&printPreviewCmd.accesskey;" command="cmd_printPreview"/>
|
||||
+ <menuitem id="menu_printPreview" label="&printPreviewCmd.label;" accesskey="&printPreviewCmd.accesskey;" oncommand="PrintUtils.printPreview(onEnterPrintPreview, onExitPrintPreview);"/>
|
||||
#endif
|
||||
<menuitem label="&printCmd.label;" accesskey="&printCmd.accesskey;" key="printKb" command="cmd_print"/>
|
||||
<menuseparator/>
|
||||
@@ -458,7 +458,7 @@
|
||||
#endif
|
||||
label="&bookmarkAllCmd.label;"
|
||||
command="Browser:BookmarkAllTabs"/>
|
||||
- <menuitem key="manBookmarkKb"
|
||||
+ <menuitem id="manBookmark" key="manBookmarkKb"
|
||||
label="&manBookmarksCmd.label;"
|
||||
oncommand="toOpenWindowByType('bookmarks:manager', 'chrome://browser/content/bookmarks/bookmarksManager.xul');"/>
|
||||
<menuseparator/>
|
||||
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
|
||||
index 0dcabc8..bcad885 100644
|
||||
--- a/browser/base/content/browser.js
|
||||
+++ b/browser/base/content/browser.js
|
||||
@@ -179,6 +179,12 @@ function UpdateBackForwardButtons()
|
||||
var backBroadcaster = document.getElementById("Browser:Back");
|
||||
var forwardBroadcaster = document.getElementById("Browser:Forward");
|
||||
|
||||
+ if (gPrefService.getBoolPref("config.lockdown.history")) {
|
||||
+ backBroadcaster.setAttribute("disabled", true);
|
||||
+ forwardBroadcaster.setAttribute("disabled", true);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
var webNavigation = gBrowser.webNavigation;
|
||||
|
||||
// Avoid setting attributes on broadcasters if the value hasn't changed!
|
||||
@@ -934,6 +940,112 @@ function prepareForStartup()
|
||||
BrowserSearch.init();
|
||||
}
|
||||
|
||||
+function lockdownElement(ident, disable)
|
||||
+{
|
||||
+ var e = document.getElementById(ident);
|
||||
+ if (disable) {
|
||||
+ e.setAttribute("disabled", "true");
|
||||
+ } else {
|
||||
+ e.removeAttribute("disabled");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+function applyLockdown(isStartup)
|
||||
+{
|
||||
+ // It is important to check that Firefox code does not change the
|
||||
+ // "disabled" state of these UI elements. Fortunately it mostly hides
|
||||
+ // elements rather than disables them.
|
||||
+ var disablePrinting = gPrefService.getBoolPref("config.lockdown.printing");
|
||||
+ var disablePrintSetup = gPrefService.getBoolPref("config.lockdown.printsetup");
|
||||
+ if (!isStartup || disablePrintSetup || disablePrintSetup) {
|
||||
+ lockdownElement("menu_printSetup", disablePrinting || disablePrintSetup);
|
||||
+ lockdownElement("menu_printPreview", disablePrinting || disablePrintSetup);
|
||||
+ lockdownElement("cmd_print", disablePrinting);
|
||||
+ }
|
||||
+
|
||||
+ var disableSave = gPrefService.getBoolPref("config.lockdown.savepage");
|
||||
+ if (!isStartup || disableSave) {
|
||||
+ lockdownElement("Browser:SavePage", disableSave);
|
||||
+ lockdownElement("menu_saveFrame", disableSave);
|
||||
+ lockdownElement("context-savepage", disableSave);
|
||||
+ lockdownElement("context-savelink", disableSave);
|
||||
+ lockdownElement("context-saveimage", disableSave);
|
||||
+ lockdownElement("View:PageSource", disableSave);
|
||||
+ lockdownElement("context-viewpartialsource-selection", disableSave);
|
||||
+ lockdownElement("context-viewpartialsource-mathml", disableSave);
|
||||
+ lockdownElement("context-viewsource", disableSave);
|
||||
+ lockdownElement("context-frame-viewFrameSourceCmd", disableSave);
|
||||
+ }
|
||||
+
|
||||
+ var disableBookmarks = gPrefService.getBoolPref("config.lockdown.hidebookmark");
|
||||
+ var disableBookmarkEditing = gPrefService.getBoolPref("config.lockdown.bookmark");
|
||||
+ if (!isStartup || disableBookmarks || disableBookmarkEditing) {
|
||||
+ lockdownElement("viewBookmarksSidebar", disableBookmarks);
|
||||
+ lockdownElement("PersonalToolbar", disableBookmarks); // XXX check
|
||||
+ lockdownElement("Browser:AddBookmarkAs", disableBookmarks || disableBookmarkEditing);
|
||||
+ lockdownElement("manBookmark", disableBookmarks || disableBookmarkEditing);
|
||||
+ lockdownElement("context-bookmarkpage", disableBookmarks || disableBookmarkEditing);
|
||||
+ lockdownElement("context-bookmarklink", disableBookmarks || disableBookmarkEditing);
|
||||
+
|
||||
+ // hide the personal bookmarks toolbar if necessary
|
||||
+ if (disableBookmarks) {
|
||||
+ document.getElementById("PersonalToolbar").setAttribute("collapsed", "true");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ var disableHistory = gPrefService.getBoolPref("config.lockdown.history");
|
||||
+ if (!isStartup || disableHistory) {
|
||||
+ lockdownElement("viewHistorySidebar", disableHistory);
|
||||
+ UpdateBackForwardButtons();
|
||||
+ var urlBar = document.getElementById("urlbar");
|
||||
+ urlBar.setAttribute("enablehistory", disableHistory ? "false" : "true");
|
||||
+ }
|
||||
+
|
||||
+ var disableURLBar = gPrefService.getBoolPref("config.lockdown.urlbar");
|
||||
+ if (!isStartup || disableURLBar) {
|
||||
+ lockdownElement("urlbar", disableURLBar);
|
||||
+ lockdownElement("Browser:OpenLocation", disableURLBar);
|
||||
+ lockdownElement("Browser:OpenFile", disableURLBar);
|
||||
+ }
|
||||
+
|
||||
+ var disableSearchBar = gPrefService.getBoolPref("config.lockdown.searchbar");
|
||||
+ if (!isStartup || disableSearchBar) {
|
||||
+ lockdownElement("searchbar-textfield", disableSearchBar);
|
||||
+ lockdownElement("searchbar-dropmarker", disableSearchBar);
|
||||
+ }
|
||||
+
|
||||
+ var disableToolbarEditing = gPrefService.getBoolPref("config.lockdown.toolbarediting");
|
||||
+ if (!isStartup || disableToolbarEditing) {
|
||||
+ var e = document.getElementById("cmd_CustomizeToolbars");
|
||||
+ if (!e.getAttribute("inCustomization")) {
|
||||
+ lockdownElement("cmd_CustomizeToolbars", disableToolbarEditing);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Close sidebar if we disabled the command that's currently in use
|
||||
+ var sidebarBox = document.getElementById("sidebar-box");
|
||||
+ var cmd = sidebarBox.getAttribute("sidebarcommand");
|
||||
+ if (cmd) {
|
||||
+ var elt = document.getElementById(cmd);
|
||||
+ if (elt && elt.getAttribute("disabled") == "true") {
|
||||
+ toggleSidebar(cmd, false);
|
||||
+ gMustLoadSidebar = false;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+var lockdownObserver = {
|
||||
+ observe: function(aSubject, aTopic, aPrefName)
|
||||
+ {
|
||||
+ try {
|
||||
+ applyLockdown(false);
|
||||
+ } catch (ex) {
|
||||
+ dump("Failed lockdown: " + ex + "\n");
|
||||
+ }
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+
|
||||
function delayedStartup()
|
||||
{
|
||||
var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
|
||||
@@ -942,7 +1054,15 @@ function delayedStartup()
|
||||
|
||||
if (!gPrefService)
|
||||
gPrefService = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
- .getService(Components.interfaces.nsIPrefBranch);
|
||||
+ .getService(Components.interfaces.nsIPrefBranchInternal);
|
||||
+ try {
|
||||
+ // do lockdown stuff in an exception handler so that if it fails
|
||||
+ // catastrophically, the browser should still come up and function
|
||||
+ applyLockdown(true);
|
||||
+ gPrefService.addObserver("config.lockdown.", lockdownObserver, false);
|
||||
+ } catch (ex) {
|
||||
+ dump("Failed lockdown: " + ex + "\n");
|
||||
+ }
|
||||
BrowserOffline.init();
|
||||
|
||||
if (gURLBar && document.documentElement.getAttribute("chromehidden").indexOf("toolbar") != -1) {
|
||||
@@ -961,8 +1081,8 @@ function delayedStartup()
|
||||
window.addEventListener("keypress", ctrlNumberTabSelection, false);
|
||||
|
||||
if (gMustLoadSidebar) {
|
||||
- var sidebar = document.getElementById("sidebar");
|
||||
var sidebarBox = document.getElementById("sidebar-box");
|
||||
+ var sidebar = document.getElementById("sidebar");
|
||||
sidebar.setAttribute("src", sidebarBox.getAttribute("src"));
|
||||
}
|
||||
|
||||
@@ -1130,6 +1250,8 @@ function BrowserShutdown()
|
||||
os.removeObserver(gSessionHistoryObserver, "browser:purge-session-history");
|
||||
os.removeObserver(gXPInstallObserver, "xpinstall-install-blocked");
|
||||
|
||||
+ gPrefService.removeObserver("config.lockdown.", lockdownObserver);
|
||||
+
|
||||
try {
|
||||
gBrowser.removeProgressListener(window.XULBrowserWindow);
|
||||
} catch (ex) {
|
||||
@@ -1687,6 +1809,9 @@ function updateGoMenu(aEvent, goMenu)
|
||||
|
||||
var history = document.getElementById("hiddenHistoryTree");
|
||||
|
||||
+ if (gPrefService.getBoolPref("config.lockdown.history"))
|
||||
+ return;
|
||||
+
|
||||
if (history.hidden) {
|
||||
history.hidden = false;
|
||||
var globalHistory = Components.classes["@mozilla.org/browser/global-history;2"]
|
||||
@@ -3355,6 +3480,7 @@ function BrowserCustomizeToolbar()
|
||||
|
||||
var cmd = document.getElementById("cmd_CustomizeToolbars");
|
||||
cmd.setAttribute("disabled", "true");
|
||||
+ cmd.setAttribute("inCustomization", "true");
|
||||
|
||||
#ifdef TOOLBAR_CUSTOMIZATION_SHEET
|
||||
document.getElementById("customizeToolbarSheetBox").hidden = false;
|
||||
@@ -3382,6 +3508,15 @@ function BrowserCustomizeToolbar()
|
||||
#endif
|
||||
}
|
||||
|
||||
+function BrowserRestoreCustomizationDisabledState()
|
||||
+{
|
||||
+ var cmd = document.getElementById("cmd_CustomizeToolbars");
|
||||
+ if (!gPrefService.getBoolPref("config.lockdown.toolbarediting")) {
|
||||
+ cmd.removeAttribute("disabled", "true");
|
||||
+ }
|
||||
+ cmd.removeAttribute("inCustomization");
|
||||
+}
|
||||
+
|
||||
function BrowserToolboxCustomizeDone(aToolboxChanged)
|
||||
{
|
||||
#ifdef TOOLBAR_CUSTOMIZATION_SHEET
|
||||
@@ -3414,8 +3549,7 @@ function BrowserToolboxCustomizeDone(aToolboxChanged)
|
||||
var menubar = document.getElementById("main-menubar");
|
||||
for (var i = 0; i < menubar.childNodes.length; ++i)
|
||||
menubar.childNodes[i].setAttribute("disabled", false);
|
||||
- var cmd = document.getElementById("cmd_CustomizeToolbars");
|
||||
- cmd.removeAttribute("disabled");
|
||||
+ BrowserRestoreCustomizationDisabledState();
|
||||
|
||||
// XXXmano bug 287105: wallpaper to bug 309953,
|
||||
// the reload button isn't in sync with the reload command.
|
||||
@@ -4176,6 +4310,9 @@ function onViewToolbarsPopupShowing(aEvent)
|
||||
menuItem.setAttribute("toolbarindex", i);
|
||||
menuItem.setAttribute("type", "checkbox");
|
||||
menuItem.setAttribute("label", toolbarName);
|
||||
+ if (toolbar.getAttribute("disabled") == "true") {
|
||||
+ menuItem.setAttribute("disabled", "true");
|
||||
+ }
|
||||
menuItem.setAttribute("accesskey", toolbar.getAttribute("accesskey"));
|
||||
menuItem.setAttribute("checked", toolbar.getAttribute("collapsed") != "true");
|
||||
popup.insertBefore(menuItem, firstMenuItem);
|
||||
@@ -4417,7 +4554,8 @@ nsContextMenu.prototype = {
|
||||
#endif
|
||||
this.showItem( "context-setDesktopBackground", haveSetDesktopBackground && this.onLoadedImage );
|
||||
|
||||
- if ( haveSetDesktopBackground && this.onLoadedImage )
|
||||
+ var lockedSetDesktopBackground = gPrefService.getBoolPref("config.lockdown.setwallpaper");
|
||||
+ if ( haveSetDesktopBackground && this.onLoadedImage && !lockedSetDesktopBackground )
|
||||
this.setItemAttr( "context-setDesktopBackground", "disabled", this.disableSetDesktopBackground());
|
||||
|
||||
// View Image depends on whether an image was clicked on.
|
||||
diff --git a/browser/base/content/pageInfo.js b/browser/base/content/pageInfo.js
|
||||
index 289aad6..e9c1f34 100644
|
||||
--- a/browser/base/content/pageInfo.js
|
||||
+++ b/browser/base/content/pageInfo.js
|
||||
@@ -757,8 +757,11 @@ function onImageSelect()
|
||||
{
|
||||
var tree = document.getElementById("imagetree");
|
||||
var saveAsButton = document.getElementById("imagesaveasbutton");
|
||||
+ var saveLocked = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
+ .getService(Components.interfaces.nsIPrefBranch)
|
||||
+ .getBoolPref("config.lockdown.savepage");
|
||||
|
||||
- if (tree.view.selection.count == 1)
|
||||
+ if (tree.view.selection.count == 1 && !saveLocked)
|
||||
{
|
||||
makePreview(tree.view.selection.currentIndex);
|
||||
saveAsButton.setAttribute("disabled", "false");
|
||||
diff --git a/browser/components/bookmarks/content/bookmarksProperties.js b/browser/components/bookmarks/content/bookmarksProperties.js
|
||||
index fddef1d..dc2beec 100644
|
||||
--- a/browser/components/bookmarks/content/bookmarksProperties.js
|
||||
+++ b/browser/components/bookmarks/content/bookmarksProperties.js
|
||||
@@ -138,6 +138,15 @@ function Init()
|
||||
// set initial focus
|
||||
nameNode.focus();
|
||||
nameNode.select();
|
||||
+
|
||||
+ // I don't know why doing this is a good idea. If bookmark editing
|
||||
+ // is disabled we shouldn't let the user into the preferences
|
||||
+ // dialog.
|
||||
+ var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
+ .getService(Components.interfaces.nsIPrefBranch);
|
||||
+ if (prefs.getBoolPref("config.lockdown.bookmark")) {
|
||||
+ document.getElementById("url").setAttribute("disabled", "true");
|
||||
+ }
|
||||
}
|
||||
|
||||
|
||||
diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js
|
||||
index 16991ac..b3f5920 100644
|
||||
--- a/modules/libpref/src/init/all.js
|
||||
+++ b/modules/libpref/src/init/all.js
|
||||
@@ -1018,6 +1018,21 @@ pref("config.use_system_prefs", false);
|
||||
// if the system has enabled accessibility
|
||||
pref("config.use_system_prefs.accessibility", false);
|
||||
|
||||
+// UI lockdown settings
|
||||
+pref("config.lockdown.printing", false);
|
||||
+pref("config.lockdown.printsetup", false);
|
||||
+pref("config.lockdown.savepage", false);
|
||||
+pref("config.lockdown.history",false);
|
||||
+pref("config.lockdown.toolbarediting",false);
|
||||
+pref("config.lockdown.urlbar",false);
|
||||
+pref("config.lockdown.bookmark",false);
|
||||
+pref("config.lockdown.disable_themes",false);
|
||||
+pref("config.lockdown.disable_extensions",false);
|
||||
+pref("config.lockdown.searchbar",false);
|
||||
+pref("config.lockdown.hidebookmark",false);
|
||||
+pref("config.lockdown.setwallpaper",false);
|
||||
+pref("config.lockdown.showsavedpasswords", false);
|
||||
+
|
||||
/*
|
||||
* What are the entities that you want Mozilla to save using mnemonic
|
||||
* names rather than numeric codes? E.g. If set, we'll output
|
||||
diff --git a/toolkit/components/help/content/toolbarCustomization.js b/toolkit/components/help/content/toolbarCustomization.js
|
||||
index 67a037b..c553e70 100644
|
||||
--- a/toolkit/components/help/content/toolbarCustomization.js
|
||||
+++ b/toolkit/components/help/content/toolbarCustomization.js
|
||||
@@ -42,11 +42,23 @@ function CustomizeToolbar(id)
|
||||
{
|
||||
var customizePopup = document.getElementById("cmd_CustomizeToolbars");
|
||||
customizePopup.setAttribute("disabled", "true");
|
||||
+ customizePopup.setAttribute("inEdit", "true");
|
||||
|
||||
window.openDialog("chrome://help/content/customizeToolbar.xul", "CustomizeToolbar",
|
||||
"chrome,all,dependent", document.getElementById(id));
|
||||
}
|
||||
|
||||
+function RestoreCustomizationDisabledState()
|
||||
+{
|
||||
+ var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
+ .getService(Components.interfaces.nsIPrefBranchInternal);
|
||||
+ var customizePopup = document.getElementById("cmd_CustomizeToolbars");
|
||||
+ if (!prefs.getBoolPref("config.lockdown.toolbarediting")) {
|
||||
+ customizePopup.removeAttribute("disabled");
|
||||
+ }
|
||||
+ customizePopup.removeAttribute("inEdit");
|
||||
+}
|
||||
+
|
||||
# ToolboxCustomizeDone() - Resets the toolbar back to its default state. Reenables
|
||||
# toolbar buttons and the "Customize Toolbar" command.
|
||||
#
|
||||
@@ -54,8 +66,7 @@ function CustomizeToolbar(id)
|
||||
function ToolboxCustomizeDone(aToolboxChanged)
|
||||
{
|
||||
# Update global UI elements that may have been added or removed
|
||||
- var customizePopup = document.getElementById("cmd_CustomizeToolbars");
|
||||
- customizePopup.removeAttribute("disabled");
|
||||
+ RestoreCustomizationDisabledState();
|
||||
|
||||
# make sure our toolbar buttons have the correct enabled state restored to them...
|
||||
if (this.UpdateToolbar != undefined)
|
||||
@@ -77,8 +88,7 @@ function UpdateToolbar(caller)
|
||||
document.commandDispatcher.updateCommands('help-toolbar');
|
||||
|
||||
# re-enable toolbar customization command
|
||||
- var customizePopup = document.getElementById("cmd_CustomizeToolbars");
|
||||
- customizePopup.removeAttribute("disabled");
|
||||
+ RestoreCustomizationDisabledState();
|
||||
|
||||
# hook for extra toolbar items
|
||||
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
|
||||
diff --git a/toolkit/components/passwordmgr/resources/content/passwordManager.js b/toolkit/components/passwordmgr/resources/content/passwordManager.js
|
||||
index d128253..e4d7e70 100644
|
||||
--- a/toolkit/components/passwordmgr/resources/content/passwordManager.js
|
||||
+++ b/toolkit/components/passwordmgr/resources/content/passwordManager.js
|
||||
@@ -137,7 +137,10 @@ function LoadSignons() {
|
||||
// disable "remove all signons" button if there are no signons
|
||||
var element = document.getElementById("removeAllSignons");
|
||||
var toggle = document.getElementById("togglePasswords");
|
||||
- if (signons.length == 0 || gSelectUserInUse) {
|
||||
+ var viewLocked = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
+ .getService(Components.interfaces.nsIPrefBranch)
|
||||
+ .getBoolPref("config.lockdown.showsavedpasswords");
|
||||
+ if (signons.length == 0 || gSelectUserInUse || viewLocked) {
|
||||
element.setAttribute("disabled","true");
|
||||
toggle.setAttribute("disabled","true");
|
||||
} else {
|
||||
diff --git a/toolkit/components/printing/content/printdialog.js b/toolkit/components/printing/content/printdialog.js
|
||||
index 4584a8a..b0c1e3d 100644
|
||||
--- a/toolkit/components/printing/content/printdialog.js
|
||||
+++ b/toolkit/components/printing/content/printdialog.js
|
||||
@@ -51,6 +51,7 @@ var gPrintSettings = null;
|
||||
var gWebBrowserPrint = null;
|
||||
var gPrintSetInterface = Components.interfaces.nsIPrintSettings;
|
||||
var doDebug = false;
|
||||
+var gPrefService = null;
|
||||
|
||||
//---------------------------------------------------
|
||||
function initDialog()
|
||||
@@ -88,11 +89,23 @@ function initDialog()
|
||||
dialog.fpDialog = document.getElementById("fpDialog");
|
||||
|
||||
dialog.enabled = false;
|
||||
+
|
||||
+ gPrefService = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
+ .getService(Components.interfaces.nsIPrefService).getBranch(null);
|
||||
+ if (gPrefService.getBoolPref("config.lockdown.savepage")) {
|
||||
+ dialog.fileRadio.setAttribute("disabled", "true");
|
||||
+ }
|
||||
+ if (gPrefService.getBoolPref("config.lockdown.printing")) {
|
||||
+ dialog.printButton.setAttribute("disabled", "true");
|
||||
+ }
|
||||
}
|
||||
|
||||
//---------------------------------------------------
|
||||
function checkInteger(element)
|
||||
{
|
||||
+ if (gPrefService.getBoolPref("config.lockdown.printing"))
|
||||
+ return;
|
||||
+
|
||||
var value = element.value;
|
||||
if (value && value.length > 0) {
|
||||
value = value.replace(/[^0-9]/g,"");
|
@ -117,7 +117,7 @@ Disables extensions and themes for this session.
|
||||
executable
|
||||
|
||||
.SH VERSION
|
||||
2.0
|
||||
3.0
|
||||
|
||||
.SH BUGS
|
||||
To report a bug, please visit \fIhttp://bugzilla.mozilla.org/\fR
|
||||
|
@ -1,90 +0,0 @@
|
||||
--- layout/base/nsCSSRendering.cpp.orig 2006-10-25 23:59:19.000000000 +0200
|
||||
+++ layout/base/nsCSSRendering.cpp 2006-10-26 00:00:04.000000000 +0200
|
||||
@@ -1000,14 +1000,14 @@
|
||||
FillOrInvertRect(aContext, dashRect.x, borderOutside.y,dashRect.width, dashRect.height-adjust,isInvert);
|
||||
FillOrInvertRect(aContext,dashRect.x,(borderOutside.YMost()-(dashRect.height-adjust)),dashRect.width, dashRect.height-adjust,isInvert);
|
||||
currRect.y += (dashRect.height-adjust);
|
||||
- temp = temp-= (dashRect.height-adjust);
|
||||
+ temp -= (dashRect.height-adjust);
|
||||
} else {
|
||||
adjust = (temp%dashRect.width)/2; // adjust a tad longer
|
||||
// draw in the left and right
|
||||
FillOrInvertRect(aContext, dashRect.x, borderOutside.y,dashRect.width, dashRect.height+adjust,isInvert);
|
||||
FillOrInvertRect(aContext, dashRect.x,(borderOutside.YMost()-(dashRect.height+adjust)),dashRect.width, dashRect.height+adjust,isInvert);
|
||||
currRect.y += (dashRect.height+adjust);
|
||||
- temp = temp-= (dashRect.height+adjust);
|
||||
+ temp -= (dashRect.height+adjust);
|
||||
}
|
||||
|
||||
if( temp > ywidth)
|
||||
@@ -1066,14 +1066,14 @@
|
||||
FillOrInvertRect(aContext, borderOutside.x,dashRect.y,dashRect.width-adjust,dashRect.height,isInvert);
|
||||
FillOrInvertRect(aContext, (borderOutside.XMost()-(dashRect.width-adjust)),dashRect.y,dashRect.width-adjust,dashRect.height,isInvert);
|
||||
currRect.x += (dashRect.width-adjust);
|
||||
- temp = temp-= (dashRect.width-adjust);
|
||||
+ temp -= (dashRect.width-adjust);
|
||||
} else {
|
||||
adjust = (temp%dashRect.width)/2;
|
||||
// draw in the left and right
|
||||
FillOrInvertRect(aContext, borderOutside.x,dashRect.y,dashRect.width+adjust,dashRect.height,isInvert);
|
||||
FillOrInvertRect(aContext, (borderOutside.XMost()-(dashRect.width+adjust)),dashRect.y,dashRect.width+adjust,dashRect.height,isInvert);
|
||||
currRect.x += (dashRect.width+adjust);
|
||||
- temp = temp-= (dashRect.width+adjust);
|
||||
+ temp -= (dashRect.width+adjust);
|
||||
}
|
||||
|
||||
|
||||
--- layout/xul/base/src/nsBox.cpp.orig 2006-10-26 00:00:26.000000000 +0200
|
||||
+++ layout/xul/base/src/nsBox.cpp 2006-10-26 00:01:30.000000000 +0200
|
||||
@@ -863,7 +863,7 @@
|
||||
while (box) {
|
||||
nsRect* overflowArea = box->GetOverflowAreaProperty();
|
||||
nsRect bounds = overflowArea ? *overflowArea + box->GetPosition() :
|
||||
- bounds = box->GetRect();
|
||||
+ box->GetRect();
|
||||
rect.UnionRect(rect, bounds);
|
||||
|
||||
box->GetNextBox(&box);
|
||||
--- intl/unicharutil/src/nsEntityConverter.cpp.orig 2005-04-02 20:44:00.000000000 +0200
|
||||
+++ intl/unicharutil/src/nsEntityConverter.cpp 2006-10-26 00:07:24.000000000 +0200
|
||||
@@ -236,7 +236,8 @@
|
||||
if (IS_HIGH_SURROGATE(inString[i]) &&
|
||||
i + 2 < len &&
|
||||
IS_LOW_SURROGATE(inString[i + 1])) {
|
||||
- key.AppendInt(SURROGATE_TO_UCS4(inString[i], inString[++i]), 10);
|
||||
+ key.AppendInt(SURROGATE_TO_UCS4(inString[i], inString[i + 1]), 10);
|
||||
+ ++i;
|
||||
}
|
||||
else {
|
||||
key.AppendInt(inString[i],10);
|
||||
--- content/events/src/nsEventStateManager.cpp.orig 2006-08-06 00:19:17.000000000 +0200
|
||||
+++ content/events/src/nsEventStateManager.cpp 2006-10-26 00:11:16.000000000 +0200
|
||||
@@ -4301,7 +4301,7 @@
|
||||
do_QueryInterface(GetDocumentOuterWindow(mDocument));
|
||||
if (newWindow) {
|
||||
nsIFocusController *newFocusController =
|
||||
- newFocusController = newWindow->GetRootFocusController();
|
||||
+ newWindow->GetRootFocusController();
|
||||
nsCOMPtr<nsPIDOMWindow> oldWindow =
|
||||
do_QueryInterface(GetDocumentOuterWindow(gLastFocusedDocument));
|
||||
if (oldWindow) {
|
||||
--- netwerk/cache/src/nsDiskCacheMap.h.orig 2006-02-04 23:01:22.000000000 +0100
|
||||
+++ netwerk/cache/src/nsDiskCacheMap.h 2006-10-26 00:15:09.000000000 +0200
|
||||
@@ -168,7 +168,7 @@
|
||||
|
||||
// set blockCount
|
||||
NS_ASSERTION( (blockCount>=1) && (blockCount<=4),"invalid block count");
|
||||
- blockCount = --blockCount;
|
||||
+ --blockCount;
|
||||
mDataLocation |= (blockCount << eExtraBlocksOffset) & eExtraBlocksMask;
|
||||
|
||||
mDataLocation |= eLocationInitializedMask;
|
||||
@@ -236,7 +236,7 @@
|
||||
|
||||
// set blockCount
|
||||
NS_ASSERTION( (blockCount>=1) && (blockCount<=4),"invalid block count");
|
||||
- blockCount = --blockCount;
|
||||
+ --blockCount;
|
||||
mMetaLocation |= (blockCount << eExtraBlocksOffset) & eExtraBlocksMask;
|
||||
|
||||
mMetaLocation |= eLocationInitializedMask;
|
3267
gconf-backend.patch
3267
gconf-backend.patch
File diff suppressed because it is too large
Load Diff
@ -1,330 +0,0 @@
|
||||
Index: extensions/cookie/nsCookiePermission.cpp
|
||||
================================================================================
|
||||
--- extensions/cookie/nsCookiePermission.cpp
|
||||
+++ extensions/cookie/nsCookiePermission.cpp
|
||||
@@ -83,6 +83,7 @@
|
||||
// obsolete pref names for migration
|
||||
static const char kCookiesLifetimeEnabled[] = "network.cookie.lifetime.enabled";
|
||||
static const char kCookiesLifetimeBehavior[] = "network.cookie.lifetime.behavior";
|
||||
+static const char kCookiesHonorExceptions[] = "network.cookie.honorExceptions";
|
||||
static const char kCookiesAskPermission[] = "network.cookie.warnAboutCookies";
|
||||
|
||||
static const char kPermissionType[] = "cookie";
|
||||
@@ -126,6 +127,7 @@
|
||||
prefBranch->AddObserver(kCookiesLifetimePolicy, this, PR_FALSE);
|
||||
prefBranch->AddObserver(kCookiesLifetimeDays, this, PR_FALSE);
|
||||
prefBranch->AddObserver(kCookiesAlwaysAcceptSession, this, PR_FALSE);
|
||||
+ prefBranch->AddObserver(kCookiesHonorExceptions, this, PR_FALSE);
|
||||
#ifdef MOZ_MAIL_NEWS
|
||||
prefBranch->AddObserver(kCookiesDisabledForMailNews, this, PR_FALSE);
|
||||
#endif
|
||||
@@ -182,6 +184,10 @@
|
||||
if (PREF_CHANGED(kCookiesAlwaysAcceptSession) &&
|
||||
NS_SUCCEEDED(aPrefBranch->GetBoolPref(kCookiesAlwaysAcceptSession, &val)))
|
||||
mCookiesAlwaysAcceptSession = val;
|
||||
+
|
||||
+ if (PREF_CHANGED(kCookiesHonorExceptions) &&
|
||||
+ NS_SUCCEEDED(aPrefBranch->GetBoolPref(kCookiesHonorExceptions, &val)))
|
||||
+ mCookiesHonorExceptions = val;
|
||||
|
||||
#ifdef MOZ_MAIL_NEWS
|
||||
if (PREF_CHANGED(kCookiesDisabledForMailNews) &&
|
||||
@@ -249,6 +255,11 @@
|
||||
#endif // MOZ_MAIL_NEWS
|
||||
|
||||
// finally, check with permission manager...
|
||||
+ if (!mCookiesHonorExceptions) {
|
||||
+ *aResult = ACCESS_DEFAULT;
|
||||
+ return NS_OK;
|
||||
+ }
|
||||
+
|
||||
nsresult rv = mPermMgr->TestPermission(aURI, kPermissionType, (PRUint32 *) aResult);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
switch (*aResult) {
|
||||
--- extensions/cookie/nsCookiePermission.h
|
||||
+++ extensions/cookie/nsCookiePermission.h
|
||||
@@ -58,10 +58,11 @@
|
||||
nsCookiePermission()
|
||||
: mCookiesLifetimeSec(LL_MAXINT)
|
||||
, mCookiesLifetimePolicy(0) // ACCEPT_NORMALLY
|
||||
- , mCookiesAlwaysAcceptSession(PR_FALSE)
|
||||
+ , mCookiesAlwaysAcceptSession(PR_FALSE),
|
||||
#ifdef MOZ_MAIL_NEWS
|
||||
- , mCookiesDisabledForMailNews(PR_TRUE)
|
||||
+ , mCookiesDisabledForMailNews(PR_TRUE),
|
||||
#endif
|
||||
+ mCookiesHonorExceptions(PR_TRUE)
|
||||
{}
|
||||
virtual ~nsCookiePermission() {}
|
||||
|
||||
@@ -77,7 +78,7 @@
|
||||
#ifdef MOZ_MAIL_NEWS
|
||||
PRPackedBool mCookiesDisabledForMailNews;
|
||||
#endif
|
||||
-
|
||||
+ PRPackedBool mCookiesHonorExceptions;
|
||||
};
|
||||
|
||||
// {CE002B28-92B7-4701-8621-CC925866FB87}
|
||||
--- extensions/permissions/nsContentBlocker.cpp
|
||||
+++ extensions/permissions/nsContentBlocker.cpp
|
||||
@@ -74,6 +74,7 @@
|
||||
nsContentBlocker::nsContentBlocker()
|
||||
{
|
||||
memset(mBehaviorPref, BEHAVIOR_ACCEPT, NUMBER_OF_TYPES);
|
||||
+ memset(mHonorExceptions, PR_TRUE, NUMBER_OF_TYPES);
|
||||
}
|
||||
|
||||
nsresult
|
||||
@@ -90,6 +91,11 @@
|
||||
rv = prefService->GetBranch("permissions.default.", getter_AddRefs(prefBranch));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
+ nsCOMPtr<nsIPrefBranch> honorExceptionsPrefBranch;
|
||||
+ rv = prefService->GetBranch("permissions.honorExceptions.",
|
||||
+ getter_AddRefs(honorExceptionsPrefBranch));
|
||||
+ NS_ENSURE_SUCCESS(rv, rv);
|
||||
+
|
||||
// Migrate old image blocker pref
|
||||
nsCOMPtr<nsIPrefBranch> oldPrefBranch;
|
||||
oldPrefBranch = do_QueryInterface(prefService);
|
||||
@@ -119,8 +125,15 @@
|
||||
mPrefBranchInternal = do_QueryInterface(prefBranch, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
+ mHonorExceptionsPrefBranchInternal =
|
||||
+ do_QueryInterface(honorExceptionsPrefBranch, &rv);
|
||||
+ NS_ENSURE_SUCCESS(rv, rv);
|
||||
+
|
||||
rv = mPrefBranchInternal->AddObserver("", this, PR_TRUE);
|
||||
- PrefChanged(prefBranch, nsnull);
|
||||
+ NS_ENSURE_SUCCESS(rv, rv);
|
||||
+
|
||||
+ rv = mHonorExceptionsPrefBranchInternal->AddObserver("", this, PR_TRUE);
|
||||
+ PrefChanged(nsnull);
|
||||
|
||||
return rv;
|
||||
}
|
||||
@@ -129,19 +142,22 @@
|
||||
#define LIMIT(x, low, high, default) ((x) >= (low) && (x) <= (high) ? (x) : (default))
|
||||
|
||||
void
|
||||
-nsContentBlocker::PrefChanged(nsIPrefBranch *aPrefBranch,
|
||||
- const char *aPref)
|
||||
+nsContentBlocker::PrefChanged(const char *aPref)
|
||||
{
|
||||
- PRInt32 val;
|
||||
-
|
||||
-#define PREF_CHANGED(_P) (!aPref || !strcmp(aPref, _P))
|
||||
-
|
||||
- for(PRUint32 i = 0; i < NUMBER_OF_TYPES; ++i) {
|
||||
- if (PREF_CHANGED(kTypeString[i]) &&
|
||||
- NS_SUCCEEDED(aPrefBranch->GetIntPref(kTypeString[i], &val)))
|
||||
- mBehaviorPref[i] = LIMIT(val, 1, 3, 1);
|
||||
+ for (PRUint32 i = 0; i < NUMBER_OF_TYPES; ++i) {
|
||||
+ if (!aPref || !strcmp(kTypeString[i], aPref)) {
|
||||
+ PRInt32 val;
|
||||
+ PRBool b;
|
||||
+ if (mPrefBranchInternal &&
|
||||
+ NS_SUCCEEDED(mPrefBranchInternal->GetIntPref(kTypeString[i], &val))) {
|
||||
+ mBehaviorPref[i] = LIMIT(val, 1, 3, 1);
|
||||
+ }
|
||||
+ if (mHonorExceptionsPrefBranchInternal &&
|
||||
+ NS_SUCCEEDED(mHonorExceptionsPrefBranchInternal->GetBoolPref(kTypeString[i], &b))) {
|
||||
+ mHonorExceptions[i] = b;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
-
|
||||
}
|
||||
|
||||
// nsIContentPolicy Implementation
|
||||
@@ -234,11 +250,13 @@
|
||||
// default prefs.
|
||||
// Don't forget the aContentType ranges from 1..8, while the
|
||||
// array is indexed 0..7
|
||||
- PRUint32 permission;
|
||||
- nsresult rv = mPermissionManager->TestPermission(aCurrentURI,
|
||||
- kTypeString[aContentType - 1],
|
||||
- &permission);
|
||||
- NS_ENSURE_SUCCESS(rv, rv);
|
||||
+ PRUint32 permission = 0;
|
||||
+ if (mHonorExceptions[aContentType - 1]) {
|
||||
+ nsresult rv = mPermissionManager->TestPermission(aCurrentURI,
|
||||
+ kTypeString[aContentType - 1],
|
||||
+ &permission);
|
||||
+ NS_ENSURE_SUCCESS(rv, rv);
|
||||
+ }
|
||||
|
||||
// If there is nothing on the list, use the default.
|
||||
if (!permission) {
|
||||
@@ -264,7 +282,7 @@
|
||||
return NS_OK;
|
||||
|
||||
PRBool trustedSource = PR_FALSE;
|
||||
- rv = aFirstURI->SchemeIs("chrome", &trustedSource);
|
||||
+ nsresult rv = aFirstURI->SchemeIs("chrome", &trustedSource);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
if (!trustedSource) {
|
||||
rv = aFirstURI->SchemeIs("resource", &trustedSource);
|
||||
@@ -329,8 +347,6 @@
|
||||
{
|
||||
NS_ASSERTION(!strcmp(NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, aTopic),
|
||||
"unexpected topic - we only deal with pref changes!");
|
||||
-
|
||||
- if (mPrefBranchInternal)
|
||||
- PrefChanged(mPrefBranchInternal, NS_LossyConvertUTF16toASCII(aData).get());
|
||||
+ PrefChanged(NS_LossyConvertUTF16toASCII(aData).get());
|
||||
return NS_OK;
|
||||
}
|
||||
--- extensions/permissions/nsContentBlocker.h
|
||||
+++ extensions/permissions/nsContentBlocker.h
|
||||
@@ -66,7 +66,7 @@
|
||||
private:
|
||||
~nsContentBlocker() {}
|
||||
|
||||
- void PrefChanged(nsIPrefBranch *, const char *);
|
||||
+ void PrefChanged(const char *);
|
||||
nsresult TestPermission(nsIURI *aCurrentURI,
|
||||
nsIURI *aFirstURI,
|
||||
PRInt32 aContentType,
|
||||
@@ -75,7 +75,9 @@
|
||||
|
||||
nsCOMPtr<nsIPermissionManager> mPermissionManager;
|
||||
nsCOMPtr<nsIPrefBranch2> mPrefBranchInternal;
|
||||
+ nsCOMPtr<nsIPrefBranch2> mHonorExceptionsPrefBranchInternal;
|
||||
PRUint8 mBehaviorPref[NUMBER_OF_TYPES];
|
||||
+ PRPackedBool mHonorExceptions[NUMBER_OF_TYPES];
|
||||
};
|
||||
|
||||
#define NS_CONTENTBLOCKER_CID \
|
||||
--- modules/libpref/src/init/all.js
|
||||
+++ modules/libpref/src/init/all.js
|
||||
@@ -716,6 +716,7 @@
|
||||
pref("network.hosts.nntp_server", "news.mozilla.org");
|
||||
|
||||
pref("permissions.default.image", 1); // 1-Accept, 2-Deny, 3-dontAcceptForeign
|
||||
+pref("permissions.honorExceptions.image", true);
|
||||
pref("network.image.warnAboutImages", false);
|
||||
pref("network.proxy.type", 0);
|
||||
pref("network.proxy.ftp", "");
|
||||
@@ -734,6 +735,7 @@
|
||||
pref("network.proxy.failover_timeout", 1800); // 30 minutes
|
||||
pref("network.online", true); //online/offline
|
||||
pref("network.cookie.cookieBehavior", 0); // 0-Accept, 1-dontAcceptForeign, 2-dontUse, 3-p3p
|
||||
+pref("network.cookie.honorExceptions", true);
|
||||
pref("network.cookie.disableCookieForMailNews", true); // disable all cookies for mail
|
||||
pref("network.cookie.lifetimePolicy", 0); // accept normally, 1-askBeforeAccepting, 2-acceptForSession,3-acceptForNDays
|
||||
pref("network.cookie.alwaysAcceptSessionCookies", false);
|
||||
--- netwerk/base/src/nsIOService.cpp
|
||||
+++ netwerk/base/src/nsIOService.cpp
|
||||
@@ -371,6 +371,16 @@
|
||||
nsCOMPtr<nsIPrefBranch2> prefBranch;
|
||||
GetPrefBranch(getter_AddRefs(prefBranch));
|
||||
if (prefBranch) {
|
||||
+ nsCAutoString protocolBlockedPref("network.protocol-handler.blocked.");
|
||||
+ protocolBlockedPref += scheme;
|
||||
+ PRBool blockedProtocol = PR_FALSE;
|
||||
+ rv = prefBranch->GetBoolPref(protocolBlockedPref.get(), &blockedProtocol);
|
||||
+ if (NS_FAILED(rv)) {
|
||||
+ rv = prefBranch->GetBoolPref("network.protocol-handler.blocked-default", &blockedProtocol);
|
||||
+ }
|
||||
+ if (NS_SUCCEEDED(rv) && blockedProtocol)
|
||||
+ return NS_ERROR_UNKNOWN_PROTOCOL;
|
||||
+
|
||||
nsCAutoString externalProtocolPref("network.protocol-handler.external.");
|
||||
externalProtocolPref += scheme;
|
||||
rv = prefBranch->GetBoolPref(externalProtocolPref.get(), &externalProtocol);
|
||||
--- widget/src/gtk2/nsWindow.cpp
|
||||
+++ widget/src/gtk2/nsWindow.cpp
|
||||
@@ -64,6 +64,7 @@
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsGfxCIID.h"
|
||||
+#include "nsIPrefService.h"
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
#include "nsPIAccessNode.h"
|
||||
@@ -73,7 +74,6 @@
|
||||
#include "stdlib.h"
|
||||
static PRBool sAccessibilityChecked = PR_FALSE;
|
||||
static PRBool sAccessibilityEnabled = PR_FALSE;
|
||||
-static const char sSysPrefService [] = "@mozilla.org/system-preference-service;1";
|
||||
static const char sAccEnv [] = "GNOME_ACCESSIBILITY";
|
||||
static const char sAccessibilityKey [] = "config.use_system_prefs.accessibility";
|
||||
#endif
|
||||
@@ -2644,18 +2644,18 @@
|
||||
sAccessibilityEnabled = atoi(envValue);
|
||||
LOG(("Accessibility Env %s=%s\n", sAccEnv, envValue));
|
||||
}
|
||||
- //check gconf-2 setting
|
||||
+ //check preference setting
|
||||
else {
|
||||
- nsCOMPtr<nsIPrefBranch> sysPrefService =
|
||||
- do_GetService(sSysPrefService, &rv);
|
||||
- if (NS_SUCCEEDED(rv) && sysPrefService) {
|
||||
-
|
||||
- // do the work to get gconf setting.
|
||||
- // will be done soon later.
|
||||
- sysPrefService->GetBoolPref(sAccessibilityKey,
|
||||
+ nsCOMPtr<nsIPrefService> prefService =
|
||||
+ do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
|
||||
+ if (NS_SUCCEEDED(rv) && prefService) {
|
||||
+ nsCOMPtr<nsIPrefBranch> prefBranch;
|
||||
+ rv = prefService->GetBranch(nsnull, getter_AddRefs(prefBranch));
|
||||
+ if (NS_SUCCEEDED(rv) && prefBranch) {
|
||||
+ prefBranch->GetBoolPref(sAccessibilityKey,
|
||||
&sAccessibilityEnabled);
|
||||
+ }
|
||||
}
|
||||
-
|
||||
}
|
||||
}
|
||||
if (sAccessibilityEnabled) {
|
||||
--- xpinstall/src/nsXPInstallManager.cpp
|
||||
+++ xpinstall/src/nsXPInstallManager.cpp
|
||||
@@ -285,6 +285,7 @@
|
||||
//-----------------------------------------------------
|
||||
// Get permission to install
|
||||
//-----------------------------------------------------
|
||||
+ nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
||||
|
||||
#ifdef ENABLE_SKIN_SIMPLE_INSTALLATION_UI
|
||||
if ( mChromeType == CHROME_SKIN )
|
||||
@@ -294,7 +295,11 @@
|
||||
|
||||
// skins get a simpler/friendlier dialog
|
||||
// XXX currently not embeddable
|
||||
- OKtoInstall = ConfirmChromeInstall( mParentWindow, packageList );
|
||||
+ PRBool themesDisabled = PR_FALSE;
|
||||
+ if (pref)
|
||||
+ pref->GetBoolPref("config.lockdown.disable_themes", &themesDisabled);
|
||||
+ OKtoInstall = !themesDisabled &&
|
||||
+ ConfirmChromeInstall( mParentWindow, packageList );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -304,12 +304,17 @@ nsXPInstallManager::InitManagerInternal(
|
||||
else
|
||||
{
|
||||
#endif
|
||||
- rv = dlgSvc->ConfirmInstall( mParentWindow,
|
||||
- packageList,
|
||||
- numStrings,
|
||||
- &OKtoInstall );
|
||||
- if (NS_FAILED(rv))
|
||||
- OKtoInstall = PR_FALSE;
|
||||
+ PRBool extensionsDisabled = PR_FALSE;
|
||||
+ if (pref)
|
||||
+ pref->GetBoolPref("config.lockdown.disable_extensions", &extensionsDisabled);
|
||||
+ if (!extensionsDisabled) {
|
||||
+ rv = dlgSvc->ConfirmInstall( mParentWindow,
|
||||
+ packageList,
|
||||
+ numStrings,
|
||||
+ &OKtoInstall );
|
||||
+ if (NS_FAILED(rv))
|
||||
+ OKtoInstall = PR_FALSE;
|
||||
+ }
|
||||
#ifdef ENABLE_SKIN_SIMPLE_INSTALLATION_UI
|
||||
}
|
||||
#endif
|
@ -1,47 +0,0 @@
|
||||
Index: uriloader/exthandler/unix/nsOSHelperAppService.cpp
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/uriloader/exthandler/unix/nsOSHelperAppService.cpp,v
|
||||
retrieving revision 1.58
|
||||
diff -d -u -p -r1.58 nsOSHelperAppService.cpp
|
||||
--- uriloader/exthandler/unix/nsOSHelperAppService.cpp 25 Oct 2004 07:46:01 -0000 1.58
|
||||
+++ uriloader/exthandler/unix/nsOSHelperAppService.cpp 21 Jul 2005 03:07:40 -0000
|
||||
@@ -1486,6 +1487,17 @@ nsOSHelperAppService::GetFromType(const
|
||||
|
||||
LOG(("Here we do a mimetype lookup for '%s'\n", aMIMEType.get()));
|
||||
|
||||
+#ifdef MOZ_WIDGET_GTK2
|
||||
+ // Look in GNOME registry first since it is the preferred method in GNOME,
|
||||
+ // should trump the mailcap entry
|
||||
+ LOG(("Looking in GNOME registry\n"));
|
||||
+ nsMIMEInfoBase *gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType.get()).get();
|
||||
+ if (gnomeInfo) {
|
||||
+ LOG(("Got MIMEInfo from GNOME registry\n"));
|
||||
+ return gnomeInfo;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
// extract the major and minor types
|
||||
NS_ConvertASCIItoUTF16 mimeType(aMIMEType);
|
||||
nsAString::const_iterator start_iter, end_iter,
|
||||
@@ -1522,21 +1534,6 @@ nsOSHelperAppService::GetFromType(const
|
||||
mozillaFlags,
|
||||
PR_TRUE);
|
||||
|
||||
-
|
||||
- if (handler.IsEmpty() && extensions.IsEmpty() &&
|
||||
- mailcap_description.IsEmpty() && mime_types_description.IsEmpty()) {
|
||||
- // No useful data yet
|
||||
-
|
||||
-#ifdef MOZ_WIDGET_GTK2
|
||||
- LOG(("Looking in GNOME registry\n"));
|
||||
- nsMIMEInfoBase *gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType.get()).get();
|
||||
- if (gnomeInfo) {
|
||||
- LOG(("Got MIMEInfo from GNOME registry\n"));
|
||||
- return gnomeInfo;
|
||||
- }
|
||||
-#endif
|
||||
- }
|
||||
-
|
||||
if (handler.IsEmpty() && mailcap_description.IsEmpty()) {
|
||||
DoLookUpHandlerAndDescription(majorType,
|
||||
minorType,
|
393
gnome-vfs.patch
393
gnome-vfs.patch
@ -1,393 +0,0 @@
|
||||
Index: uriloader/exthandler/Makefile.in
|
||||
================================================================================
|
||||
--- uriloader/exthandler/Makefile.in
|
||||
+++ uriloader/exthandler/Makefile.in
|
||||
@@ -103,7 +103,7 @@
|
||||
LOCAL_INCLUDES = -I$(srcdir)
|
||||
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
|
||||
-OSHELPER += nsGNOMERegistry.cpp
|
||||
+OSHELPER += nsMIMEInfoUnix.cpp nsGNOMERegistry.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),beos)
|
||||
--- uriloader/exthandler/unix/nsGNOMERegistry.cpp
|
||||
+++ uriloader/exthandler/unix/nsGNOMERegistry.cpp
|
||||
@@ -42,7 +42,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsILocalFile.h"
|
||||
-#include "nsMIMEInfoImpl.h"
|
||||
+#include "nsMIMEInfoUnix.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
#include <glib.h>
|
||||
@@ -56,12 +56,12 @@
|
||||
typedef struct _GnomeProgram GnomeProgram;
|
||||
typedef struct _GnomeModuleInfo GnomeModuleInfo;
|
||||
|
||||
-typedef struct {
|
||||
+struct GnomeVFSMimeApplication {
|
||||
char *id;
|
||||
char *name;
|
||||
char *command;
|
||||
/* there is more here, but we don't need it */
|
||||
-} GnomeVFSMimeApplication;
|
||||
+};
|
||||
|
||||
typedef GConfClient * (*_gconf_client_get_default_fn)();
|
||||
typedef gchar * (*_gconf_client_get_string_fn)(GConfClient *,
|
||||
@@ -264,7 +264,7 @@
|
||||
}
|
||||
|
||||
|
||||
-/* static */ already_AddRefed<nsMIMEInfoBase>
|
||||
+/* static */ already_AddRefed<nsMIMEInfoUnix>
|
||||
nsGNOMERegistry::GetFromExtension(const char *aFileExt)
|
||||
{
|
||||
if (!gconfLib)
|
||||
@@ -286,7 +286,7 @@
|
||||
return GetFromType(mimeType);
|
||||
}
|
||||
|
||||
-/* static */ already_AddRefed<nsMIMEInfoBase>
|
||||
+/* static */ already_AddRefed<nsMIMEInfoUnix>
|
||||
nsGNOMERegistry::GetFromType(const char *aMIMEType)
|
||||
{
|
||||
if (!gconfLib)
|
||||
@@ -296,9 +296,11 @@
|
||||
if (!handlerApp)
|
||||
return nsnull;
|
||||
|
||||
- nsRefPtr<nsMIMEInfoImpl> mimeInfo = new nsMIMEInfoImpl(aMIMEType);
|
||||
+ nsRefPtr<nsMIMEInfoUnix> mimeInfo = new nsMIMEInfoUnix(aMIMEType);
|
||||
NS_ENSURE_TRUE(mimeInfo, nsnull);
|
||||
|
||||
+ mimeInfo->SetDefaultGnomeVFSMimeApplication(handlerApp);
|
||||
+
|
||||
// Get the list of extensions and append then to the mimeInfo.
|
||||
GList *extensions = _gnome_vfs_mime_get_extensions_list(aMIMEType);
|
||||
for (GList *extension = extensions; extension; extension = extension->next)
|
||||
@@ -320,11 +322,21 @@
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
- gchar *commandPath = g_find_program_in_path(nativeCommand);
|
||||
+ gchar **argv;
|
||||
+ gboolean res = g_shell_parse_argv(nativeCommand, NULL, &argv, NULL);
|
||||
+ if (!res) {
|
||||
+ NS_ERROR("Could not convert helper app command to filesystem encoding");
|
||||
+ _gnome_vfs_mime_application_free(handlerApp);
|
||||
+ return nsnull;
|
||||
+ }
|
||||
+
|
||||
+ gchar *commandPath = g_find_program_in_path(argv[0]);
|
||||
|
||||
g_free(nativeCommand);
|
||||
+ g_strfreev(argv);
|
||||
|
||||
if (!commandPath) {
|
||||
+ NS_WARNING("could not find command in path");
|
||||
_gnome_vfs_mime_application_free(handlerApp);
|
||||
return nsnull;
|
||||
}
|
||||
@@ -342,7 +354,7 @@
|
||||
|
||||
_gnome_vfs_mime_application_free(handlerApp);
|
||||
|
||||
- nsMIMEInfoBase* retval;
|
||||
+ nsMIMEInfoUnix* retval;
|
||||
NS_ADDREF((retval = mimeInfo));
|
||||
return retval;
|
||||
}
|
||||
--- uriloader/exthandler/unix/nsGNOMERegistry.h
|
||||
+++ uriloader/exthandler/unix/nsGNOMERegistry.h
|
||||
@@ -35,10 +35,13 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
+#ifndef nsGNOMERegistry_h__
|
||||
+#define nsGNOMERegistry_h__
|
||||
+
|
||||
#include "nsIURI.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
-class nsMIMEInfoBase;
|
||||
+class nsMIMEInfoUnix;
|
||||
|
||||
class nsGNOMERegistry
|
||||
{
|
||||
@@ -52,7 +55,9 @@
|
||||
static void GetAppDescForScheme(const nsACString& aScheme,
|
||||
nsAString& aDesc);
|
||||
|
||||
- static already_AddRefed<nsMIMEInfoBase> GetFromExtension(const char *aFileExt);
|
||||
+ static already_AddRefed<nsMIMEInfoUnix> GetFromExtension(const char *aFileExt);
|
||||
|
||||
- static already_AddRefed<nsMIMEInfoBase> GetFromType(const char *aMIMEType);
|
||||
+ static already_AddRefed<nsMIMEInfoUnix> GetFromType(const char *aMIMEType);
|
||||
};
|
||||
+
|
||||
+#endif // nsGNOMERegistry_h__
|
||||
--- uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
|
||||
+++ uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
|
||||
@@ -0,0 +1,196 @@
|
||||
+/* ***** BEGIN LICENSE BLOCK *****
|
||||
+ * Version: MPL 1.1
|
||||
+ *
|
||||
+ * The contents of this file are subject to the Mozilla Public License Version
|
||||
+ * 1.1 (the "License"); you may not use this file except in compliance with
|
||||
+ * the License. You may obtain a copy of the License at
|
||||
+ * http://www.mozilla.org/MPL/
|
||||
+ *
|
||||
+ * Software distributed under the License is distributed on an "AS IS" basis,
|
||||
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
+ * for the specific language governing rights and limitations under the
|
||||
+ * License.
|
||||
+ *
|
||||
+ * The Original Code is mozilla.org Code.
|
||||
+ *
|
||||
+ * The Initial Developer of the Original Code is
|
||||
+ * Red Hat, Inc.
|
||||
+ * Portions created by the Initial Developer are Copyright (C) 2005
|
||||
+ * the Initial Developer. All Rights Reserved.
|
||||
+ *
|
||||
+ * Contributor(s):
|
||||
+ * Christopher Aillon <caillon@redhat.com> (Original author)
|
||||
+ *
|
||||
+ *
|
||||
+ * ***** END LICENSE BLOCK ***** */
|
||||
+
|
||||
+#include "nsMIMEInfoUnix.h"
|
||||
+#include "prlink.h"
|
||||
+#include "prmem.h"
|
||||
+#include <glib.h>
|
||||
+#include <glib-object.h>
|
||||
+
|
||||
+static PRLibrary *gnomeLib;
|
||||
+static PRLibrary *vfsLib;
|
||||
+
|
||||
+typedef struct _GnomeProgram GnomeProgram;
|
||||
+typedef struct _GnomeModuleInfo GnomeModuleInfo;
|
||||
+
|
||||
+typedef enum {
|
||||
+ GNOME_VFS_OK // there's more but we don't care about them.
|
||||
+} GnomeVFSResult;
|
||||
+
|
||||
+typedef GnomeVFSResult (*_gnome_vfs_mime_application_launch_fn)
|
||||
+ (GnomeVFSMimeApplication *app,
|
||||
+ GList *uris);
|
||||
+typedef void (*_gnome_vfs_mime_application_free_fn)(GnomeVFSMimeApplication *);
|
||||
+typedef GnomeVFSMimeApplication * (*_gnome_vfs_mime_application_copy_fn)(GnomeVFSMimeApplication *);
|
||||
+typedef GnomeProgram * (*_gnome_program_init_fn)(const char *, const char *,
|
||||
+ const GnomeModuleInfo *, int,
|
||||
+ char **, const char *, ...);
|
||||
+typedef const char * (*_gnome_vfs_mime_application_get_name_fn)(GnomeVFSMimeApplication *);
|
||||
+typedef const GnomeModuleInfo * (*_libgnome_module_info_get_fn)();
|
||||
+typedef GnomeProgram * (*_gnome_program_get_fn)();
|
||||
+typedef char * (*_gnome_vfs_make_uri_from_input_fn)(const char *);
|
||||
+
|
||||
+#define DECL_FUNC_PTR(func) static _##func##_fn _##func
|
||||
+
|
||||
+DECL_FUNC_PTR(gnome_vfs_mime_application_launch);
|
||||
+DECL_FUNC_PTR(gnome_vfs_mime_application_free);
|
||||
+DECL_FUNC_PTR(gnome_vfs_mime_application_copy);
|
||||
+DECL_FUNC_PTR(gnome_vfs_mime_application_get_name);
|
||||
+DECL_FUNC_PTR(gnome_program_init);
|
||||
+DECL_FUNC_PTR(gnome_program_get);
|
||||
+DECL_FUNC_PTR(libgnome_module_info_get);
|
||||
+DECL_FUNC_PTR(gnome_vfs_make_uri_from_input);
|
||||
+
|
||||
+static PRLibrary *
|
||||
+LoadVersionedLibrary(const char* libName, const char* libVersion)
|
||||
+{
|
||||
+ char *platformLibName = PR_GetLibraryName(nsnull, libName);
|
||||
+ nsCAutoString versionLibName(platformLibName);
|
||||
+ versionLibName.Append(libVersion);
|
||||
+ PR_Free(platformLibName);
|
||||
+ return PR_LoadLibrary(versionLibName.get());
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+Cleanup()
|
||||
+{
|
||||
+ // Unload all libraries
|
||||
+ if (gnomeLib)
|
||||
+ PR_UnloadLibrary(gnomeLib);
|
||||
+ if (vfsLib)
|
||||
+ PR_UnloadLibrary(vfsLib);
|
||||
+
|
||||
+ gnomeLib = vfsLib = nsnull;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+InitGnomeVFS()
|
||||
+{
|
||||
+ static PRBool initialized = PR_FALSE;
|
||||
+
|
||||
+ if (initialized)
|
||||
+ return;
|
||||
+
|
||||
+ #define ENSURE_LIB(lib) \
|
||||
+ PR_BEGIN_MACRO \
|
||||
+ if (!lib) { \
|
||||
+ Cleanup(); \
|
||||
+ return; \
|
||||
+ } \
|
||||
+ PR_END_MACRO
|
||||
+
|
||||
+ #define GET_LIB_FUNCTION(lib, func, failure) \
|
||||
+ PR_BEGIN_MACRO \
|
||||
+ _##func = (_##func##_fn) PR_FindFunctionSymbol(lib##Lib, #func); \
|
||||
+ if (!_##func) { \
|
||||
+ failure; \
|
||||
+ } \
|
||||
+ PR_END_MACRO
|
||||
+
|
||||
+ // Attempt to open libgnome
|
||||
+ gnomeLib = LoadVersionedLibrary("gnome-2", ".0");
|
||||
+ ENSURE_LIB(gnomeLib);
|
||||
+
|
||||
+ GET_LIB_FUNCTION(gnome, gnome_program_init, return Cleanup());
|
||||
+ GET_LIB_FUNCTION(gnome, libgnome_module_info_get, return Cleanup());
|
||||
+ GET_LIB_FUNCTION(gnome, gnome_program_get, return Cleanup());
|
||||
+
|
||||
+ // Attempt to open libgnomevfs
|
||||
+ vfsLib = LoadVersionedLibrary("gnomevfs-2", ".0");
|
||||
+ ENSURE_LIB(vfsLib);
|
||||
+
|
||||
+ GET_LIB_FUNCTION(vfs, gnome_vfs_mime_application_launch, /* do nothing */);
|
||||
+ GET_LIB_FUNCTION(vfs, gnome_vfs_make_uri_from_input, return Cleanup());
|
||||
+ GET_LIB_FUNCTION(vfs, gnome_vfs_mime_application_get_name, return Cleanup());
|
||||
+ GET_LIB_FUNCTION(vfs, gnome_vfs_mime_application_free, return Cleanup());
|
||||
+ GET_LIB_FUNCTION(vfs, gnome_vfs_mime_application_copy, return Cleanup());
|
||||
+
|
||||
+ // Initialize GNOME, if it's not already initialized. It's not
|
||||
+ // necessary to tell GNOME about our actual command line arguments.
|
||||
+
|
||||
+ if (!_gnome_program_get()) {
|
||||
+ char *argv[1] = { "gecko" };
|
||||
+ _gnome_program_init("Gecko", "1.0", _libgnome_module_info_get(),
|
||||
+ 1, argv, NULL);
|
||||
+ }
|
||||
+
|
||||
+ // Note: after GNOME has been initialized, do not ever unload these
|
||||
+ // libraries. They register atexit handlers, so if they are unloaded, we'll
|
||||
+ // crash on exit.
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+nsMIMEInfoUnix::SetDefaultGnomeVFSMimeApplication(GnomeVFSMimeApplication* app)
|
||||
+{
|
||||
+ if (_gnome_vfs_mime_application_copy && _gnome_vfs_mime_application_free) {
|
||||
+ mDefaultVFSApplication = _gnome_vfs_mime_application_copy(app);
|
||||
+
|
||||
+ mPreferredAction = nsIMIMEInfo::useSystemDefault;
|
||||
+
|
||||
+ const gchar * name = _gnome_vfs_mime_application_get_name(mDefaultVFSApplication);
|
||||
+ if (name)
|
||||
+ mDefaultAppDescription = NS_ConvertUTF8toUCS2(name);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+nsMIMEInfoUnix::~nsMIMEInfoUnix()
|
||||
+{
|
||||
+ if (mDefaultVFSApplication)
|
||||
+ _gnome_vfs_mime_application_free(mDefaultVFSApplication);
|
||||
+}
|
||||
+
|
||||
+nsresult
|
||||
+nsMIMEInfoUnix::LaunchDefaultWithFile(nsIFile* aFile)
|
||||
+{
|
||||
+ NS_ENSURE_ARG_POINTER(aFile);
|
||||
+
|
||||
+ InitGnomeVFS();
|
||||
+
|
||||
+ if (_gnome_vfs_mime_application_launch && mDefaultVFSApplication) {
|
||||
+ nsCAutoString nativePath;
|
||||
+ aFile->GetNativePath(nativePath);
|
||||
+
|
||||
+ gchar *uri = _gnome_vfs_make_uri_from_input(nativePath.get());
|
||||
+
|
||||
+ GList *uris = NULL;
|
||||
+ uris = g_list_append(uris, uri);
|
||||
+
|
||||
+ GnomeVFSResult result = _gnome_vfs_mime_application_launch(mDefaultVFSApplication, uris);
|
||||
+
|
||||
+ g_free(uri);
|
||||
+ g_list_free(uris);
|
||||
+
|
||||
+ if (result != GNOME_VFS_OK)
|
||||
+ return NS_ERROR_FAILURE;
|
||||
+
|
||||
+ return NS_OK;
|
||||
+ }
|
||||
+
|
||||
+ if (!mDefaultApplication)
|
||||
+ return NS_ERROR_FILE_NOT_FOUND;
|
||||
+
|
||||
+ return LaunchWithIProcess(mDefaultApplication, aFile);
|
||||
+}
|
||||
--- uriloader/exthandler/unix/nsMIMEInfoUnix.h
|
||||
+++ uriloader/exthandler/unix/nsMIMEInfoUnix.h
|
||||
@@ -0,0 +1,50 @@
|
||||
+/* ***** BEGIN LICENSE BLOCK *****
|
||||
+ * Version: MPL 1.1
|
||||
+ *
|
||||
+ * The contents of this file are subject to the Mozilla Public License Version
|
||||
+ * 1.1 (the "License"); you may not use this file except in compliance with
|
||||
+ * the License. You may obtain a copy of the License at
|
||||
+ * http://www.mozilla.org/MPL/
|
||||
+ *
|
||||
+ * Software distributed under the License is distributed on an "AS IS" basis,
|
||||
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
+ * for the specific language governing rights and limitations under the
|
||||
+ * License.
|
||||
+ *
|
||||
+ * The Original Code is mozilla.org Code.
|
||||
+ *
|
||||
+ * The Initial Developer of the Original Code is
|
||||
+ * Red Hat, Inc.
|
||||
+ * Portions created by the Initial Developer are Copyright (C) 2005
|
||||
+ * the Initial Developer. All Rights Reserved.
|
||||
+ *
|
||||
+ * Contributor(s):
|
||||
+ * Christopher Aillon <caillon@redhat.com> (Original author)
|
||||
+ *
|
||||
+ *
|
||||
+ * ***** END LICENSE BLOCK ***** */
|
||||
+
|
||||
+#ifndef nsMimeInfoUnix_h__
|
||||
+#define nsMimeInfoUnix_h__
|
||||
+
|
||||
+#include "nsMIMEInfoImpl.h"
|
||||
+
|
||||
+struct GnomeVFSMimeApplication;
|
||||
+
|
||||
+class nsMIMEInfoUnix : public nsMIMEInfoImpl
|
||||
+{
|
||||
+public:
|
||||
+ nsMIMEInfoUnix(const char* aType = "") : nsMIMEInfoImpl(aType), mDefaultVFSApplication(nsnull) {}
|
||||
+ nsMIMEInfoUnix(const nsACString& aMIMEType) : nsMIMEInfoImpl(aMIMEType) {};
|
||||
+
|
||||
+ virtual ~nsMIMEInfoUnix();
|
||||
+
|
||||
+ void SetDefaultGnomeVFSMimeApplication(GnomeVFSMimeApplication *app);
|
||||
+
|
||||
+protected:
|
||||
+ virtual NS_HIDDEN_(nsresult) LaunchDefaultWithFile(nsIFile* aFile);
|
||||
+
|
||||
+ GnomeVFSMimeApplication *mDefaultVFSApplication;
|
||||
+};
|
||||
+
|
||||
+#endif // nsMimeInfoUnix_h__
|
||||
--- uriloader/exthandler/unix/nsOSHelperAppService.cpp
|
||||
+++ uriloader/exthandler/unix/nsOSHelperAppService.cpp
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "nsOSHelperAppService.h"
|
||||
#ifdef MOZ_WIDGET_GTK2
|
||||
#include "nsGNOMERegistry.h"
|
||||
+#include "nsMIMEInfoUnix.h"
|
||||
#endif
|
||||
#include "nsISupports.h"
|
||||
#include "nsString.h"
|
@ -1,28 +0,0 @@
|
||||
Index: docshell/base/nsDocShell.cpp
|
||||
================================================================================
|
||||
--- docshell/base/nsDocShell.cpp
|
||||
+++ docshell/base/nsDocShell.cpp
|
||||
@@ -5758,6 +5758,9 @@
|
||||
if (onLocationChangeNeeded) {
|
||||
FireOnLocationChange(this, request, mCurrentURI);
|
||||
}
|
||||
+
|
||||
+ FireOnStateChange(this, request,
|
||||
+ STATE_TRANSFERRING|STATE_IS_NETWORK|STATE_IS_DOCUMENT, NS_OK);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
--- xpfe/browser/src/nsBrowserStatusFilter.cpp
|
||||
+++ xpfe/browser/src/nsBrowserStatusFilter.cpp
|
||||
@@ -152,8 +152,10 @@
|
||||
if (aStateFlags & STATE_IS_REQUEST) {
|
||||
if (!mUseRealProgressFlag && mTotalRequests)
|
||||
return OnProgressChange(nsnull, nsnull, 0, 0, mFinishedRequests, mTotalRequests);
|
||||
+ } else if (aStateFlags & STATE_IS_DOCUMENT) {
|
||||
+ return mListener->OnStateChange(aWebProgress, aRequest, aStateFlags,
|
||||
+ aStatus);
|
||||
}
|
||||
-
|
||||
// no need to forward this state change
|
||||
return NS_OK;
|
||||
} else {
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a800b4dd45f5be81b677be9483fa2876f8f9d8895855180814e128528d2c15bc
|
||||
size 10954030
|
3
l10n-2.9.94.tar.bz2
Normal file
3
l10n-2.9.94.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b6fe85f1138569a7c6d8cc325a66f26e13ec35bed92c25a3afc897b3e1fbc293
|
||||
size 24222894
|
11
locale.patch
11
locale.patch
@ -1,11 +0,0 @@
|
||||
--- modules/libpref/src/init/all.js.orig 2004-10-15 14:50:11.740865580 +0200
|
||||
+++ modules/libpref/src/init/all.js 2004-10-15 14:50:34.371625152 +0200
|
||||
@@ -653,7 +653,7 @@
|
||||
pref("intl.charset.detector", "chrome://navigator/locale/navigator.properties");
|
||||
pref("intl.charset.default", "chrome://navigator-platform/locale/navigator.properties");
|
||||
pref("intl.content.langcode", "chrome://communicator-region/locale/region.properties");
|
||||
-pref("intl.locale.matchOS", false);
|
||||
+pref("intl.locale.matchOS", true);
|
||||
// fallback charset list for Unicode conversion (converting from Unicode)
|
||||
// currently used for mail send only to handle symbol characters (e.g Euro, trademark, smartquotes)
|
||||
// for ISO-8859-1
|
20
misc.dif
20
misc.dif
@ -1,20 +0,0 @@
|
||||
--- gfx/src/x11shared/nsFT2FontCatalog.cpp
|
||||
+++ gfx/src/x11shared/nsFT2FontCatalog.cpp
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
+#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <dirent.h>
|
||||
@@ -92,9 +93,6 @@
|
||||
// Called to get the TrueType font summary from the disk font catalog.
|
||||
//
|
||||
|
||||
-// Solaris is missing a prototype for ctime
|
||||
-extern "C" {char *ctime(const time_t *timep);}
|
||||
-
|
||||
#include <ft2build.h>
|
||||
#include FT_GLYPH_H
|
||||
#include FT_FREETYPE_H
|
@ -1,146 +0,0 @@
|
||||
References:
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=403675
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=386362
|
||||
|
||||
Index: modules/libpr0n/encoders/png/nsPNGEncoder.h
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/modules/libpr0n/encoders/png/nsPNGEncoder.h,v
|
||||
retrieving revision 1.1.18.1
|
||||
diff -u -p -6 -r1.1.18.1 nsPNGEncoder.h
|
||||
--- modules/libpr0n/encoders/png/nsPNGEncoder.h 20 May 2006 17:20:49 -0000 1.1.18.1
|
||||
+++ modules/libpr0n/encoders/png/nsPNGEncoder.h 13 Nov 2007 22:07:36 -0000
|
||||
@@ -35,14 +35,16 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "imgIEncoder.h"
|
||||
#ifdef MOZILLA_1_8_BRANCH
|
||||
#define imgIEncoder imgIEncoder_MOZILLA_1_8_BRANCH
|
||||
+#ifndef NS_DECL_IMGIENCODER
|
||||
#define NS_DECL_IMGIENCODER NS_DECL_IMGIENCODER_MOZILLA_1_8_BRANCH
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#include <png.h>
|
||||
|
||||
#define NS_PNGENCODER_CID \
|
||||
{ /* 38d1592e-b81e-432b-86f8-471878bbfe07 */ \
|
||||
0x38d1592e, \
|
||||
@@ -60,12 +62,20 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_IMGIENCODER
|
||||
NS_DECL_NSIINPUTSTREAM
|
||||
|
||||
nsPNGEncoder();
|
||||
|
||||
+ NS_IMETHOD InitFromData(const PRUint8* aData,
|
||||
+ PRUint32 aLength, // (unused, req'd by JS)
|
||||
+ PRUint32 aWidth,
|
||||
+ PRUint32 aHeight,
|
||||
+ PRUint32 aStride,
|
||||
+ PRUint32 aInputFormat,
|
||||
+ const nsAString& aOutputOptions);
|
||||
+
|
||||
private:
|
||||
~nsPNGEncoder();
|
||||
|
||||
protected:
|
||||
void ConvertHostARGBRow(const PRUint8* aSrc, PRUint8* aDest,
|
||||
PRUint32 aPixelWidth, PRBool aUseTransparency);
|
||||
Index: modules/libpr0n/encoders/jpeg/nsJPEGEncoder.h
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/modules/libpr0n/encoders/jpeg/nsJPEGEncoder.h,v
|
||||
retrieving revision 1.1.14.1
|
||||
diff -u -p -6 -r1.1.14.1 nsJPEGEncoder.h
|
||||
--- modules/libpr0n/encoders/jpeg/nsJPEGEncoder.h 20 May 2006 17:20:48 -0000 1.1.14.1
|
||||
+++ modules/libpr0n/encoders/jpeg/nsJPEGEncoder.h 13 Nov 2007 22:07:57 -0000
|
||||
@@ -36,14 +36,16 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "imgIEncoder.h"
|
||||
#ifdef MOZILLA_1_8_BRANCH
|
||||
#define imgIEncoder imgIEncoder_MOZILLA_1_8_BRANCH
|
||||
+#ifndef NS_DECL_IMGIENCODER
|
||||
#define NS_DECL_IMGIENCODER NS_DECL_IMGIENCODER_MOZILLA_1_8_BRANCH
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
// needed for JPEG library
|
||||
#include <stdio.h>
|
||||
|
||||
extern "C" {
|
||||
#include "jpeglib.h"
|
||||
@@ -66,12 +68,20 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_IMGIENCODER
|
||||
NS_DECL_NSIINPUTSTREAM
|
||||
|
||||
nsJPEGEncoder();
|
||||
|
||||
+ NS_IMETHOD InitFromData(const PRUint8* aData,
|
||||
+ PRUint32 aLength, // (unused, req'd by JS)
|
||||
+ PRUint32 aWidth,
|
||||
+ PRUint32 aHeight,
|
||||
+ PRUint32 aStride,
|
||||
+ PRUint32 aInputFormat,
|
||||
+ const nsAString& aOutputOptions);
|
||||
+
|
||||
private:
|
||||
~nsJPEGEncoder();
|
||||
|
||||
protected:
|
||||
|
||||
void ConvertHostARGBRow(const PRUint8* aSrc, PRUint8* aDest,
|
||||
Index: modules/libpr0n/public/imgIEncoder.idl
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/modules/libpr0n/public/imgIEncoder.idl,v
|
||||
retrieving revision 1.1.10.3
|
||||
diff -u -p -r1.1.10.3 imgIEncoder.idl
|
||||
--- modules/libpr0n/public/imgIEncoder.idl 20 May 2006 17:20:49 -0000 1.1.10.3
|
||||
+++ modules/libpr0n/public/imgIEncoder.idl 14 Nov 2007 10:41:40 -0000
|
||||
@@ -96,6 +96,6 @@ interface nsIFile;
|
||||
[scriptable, uuid(CCC5B3AD-3E67-4e3d-97E1-B06B2E96FEF8)]
|
||||
interface imgIEncoder : nsISupports
|
||||
{
|
||||
- void encodeClipboardImage(in nsIClipboardImage aClipboardImage, out nsIFile aImageFile);
|
||||
+ /* void encodeClipboardImage(in nsIClipboardImage aClipboardImage, out nsIFile aImageFile); */
|
||||
};
|
||||
|
||||
Index: xpcom/obsolete/component/nsFileSpecImpl.h
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/xpcom/obsolete/component/nsFileSpecImpl.h,v
|
||||
retrieving revision 1.3
|
||||
diff -u -p -6 -r1.3 nsFileSpecImpl.h
|
||||
--- xpcom/obsolete/component/nsFileSpecImpl.h 18 Apr 2004 14:18:15 -0000 1.3
|
||||
+++ xpcom/obsolete/component/nsFileSpecImpl.h 14 Nov 2007 12:11:12 -0000
|
||||
@@ -40,13 +40,13 @@
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsIFileSpec.h"
|
||||
#include "nsFileSpec.h"
|
||||
|
||||
//========================================================================================
|
||||
-class nsFileSpecImpl
|
||||
+class NS_COM nsFileSpecImpl
|
||||
//========================================================================================
|
||||
: public nsIFileSpec
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
@@ -78,13 +78,13 @@ class nsFileSpecImpl
|
||||
|
||||
private:
|
||||
~nsFileSpecImpl();
|
||||
}; // class nsFileSpecImpl
|
||||
|
||||
//========================================================================================
|
||||
-class nsDirectoryIteratorImpl
|
||||
+class NS_COM nsDirectoryIteratorImpl
|
||||
//========================================================================================
|
||||
: public nsIDirectoryIterator
|
||||
{
|
||||
|
||||
public:
|
||||
|
@ -1,181 +0,0 @@
|
||||
From: upstream
|
||||
Subject: crashes with Factory's glibc
|
||||
References:
|
||||
https://bugzilla.novell.com/show_bug.cgi?id=354150
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=412610
|
||||
|
||||
--- mozilla/toolkit/xre/nsAppRunner.h.old 2007-09-25 18:01:56.000000000 +0200
|
||||
+++ mozilla/toolkit/xre/nsAppRunner.h 2007-09-25 18:02:23.000000000 +0200
|
||||
@@ -48,7 +48,8 @@
|
||||
#elif defined(CCHMAXPATH)
|
||||
#define MAXPATHLEN CCHMAXPATH
|
||||
#else
|
||||
-#define MAXPATHLEN 1024
|
||||
+#include <limits.h>
|
||||
+#define MAXPATHLEN PATH_MAX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
diff -up mozilla/toolkit/mozapps/update/src/updater/updater.cpp.old mozilla/toolkit/mozapps/update/src/updater/updater.cpp
|
||||
--- mozilla/toolkit/mozapps/update/src/updater/updater.cpp.old 2007-09-25 18:00:26.000000000 +0200
|
||||
+++ mozilla/toolkit/mozapps/update/src/updater/updater.cpp 2007-09-25 18:00:53.000000000 +0200
|
||||
@@ -107,7 +107,8 @@ void LaunchChild(int argc, char **argv);
|
||||
# elif defined(CCHMAXPATH)
|
||||
# define MAXPATHLEN CCHMAXPATH
|
||||
# else
|
||||
-# define MAXPATHLEN 1024
|
||||
+# include <limits.h>
|
||||
+# define MAXPATHLEN PATH_MAX
|
||||
# endif
|
||||
#endif
|
||||
|
||||
diff -up mozilla/xpcom/io/SpecialSystemDirectory.cpp.old mozilla/xpcom/io/SpecialSystemDirectory.cpp
|
||||
--- mozilla/xpcom/io/SpecialSystemDirectory.cpp.old 2007-09-25 18:04:25.000000000 +0200
|
||||
+++ mozilla/xpcom/io/SpecialSystemDirectory.cpp 2007-09-25 18:04:48.000000000 +0200
|
||||
@@ -109,7 +109,8 @@
|
||||
#elif defined(CCHMAXPATH)
|
||||
#define MAXPATHLEN CCHMAXPATH
|
||||
#else
|
||||
-#define MAXPATHLEN 1024
|
||||
+#include <limits.h>
|
||||
+#define MAXPATHLEN PATH_MAX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
diff -up mozilla/xpcom/obsolete/nsFileSpecUnix.cpp.old mozilla/xpcom/obsolete/nsFileSpecUnix.cpp
|
||||
--- mozilla/xpcom/obsolete/nsFileSpecUnix.cpp.old 2006-11-28 01:18:37.000000000 +0100
|
||||
+++ mozilla/xpcom/obsolete/nsFileSpecUnix.cpp 2007-09-25 18:05:49.000000000 +0200
|
||||
@@ -79,7 +79,8 @@
|
||||
#endif
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
-#define MAXPATHLEN 1024 /* Guessing this is okay. Works for SCO. */
|
||||
+#include <limits.h>
|
||||
+#define MAXPATHLEN PATH_MAX /* Guessing this is okay. Works for SCO. */
|
||||
#endif
|
||||
|
||||
#if defined(__QNX__)
|
||||
diff -up mozilla/xpcom/build/nsXPCOMPrivate.h.old mozilla/xpcom/build/nsXPCOMPrivate.h
|
||||
--- mozilla/xpcom/build/nsXPCOMPrivate.h.old 2007-09-25 18:02:58.000000000 +0200
|
||||
+++ mozilla/xpcom/build/nsXPCOMPrivate.h 2007-09-25 18:03:15.000000000 +0200
|
||||
@@ -252,7 +252,8 @@ NS_GetFrozenFunctions(XPCOMFunctions *en
|
||||
#elif defined(CCHMAXPATH)
|
||||
#define MAXPATHLEN CCHMAXPATH
|
||||
#else
|
||||
-#define MAXPATHLEN 1024
|
||||
+#include <limits.h>
|
||||
+#define MAXPATHLEN PATH_MAX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
diff -up mozilla/dbm/include/mcom_db.h.old mozilla/dbm/include/mcom_db.h
|
||||
--- mozilla/dbm/include/mcom_db.h.old 2007-09-25 17:57:09.000000000 +0200
|
||||
+++ mozilla/dbm/include/mcom_db.h 2007-09-25 17:57:49.000000000 +0200
|
||||
@@ -214,7 +214,8 @@
|
||||
#endif /* __DBINTERFACE_PRIVATE */
|
||||
|
||||
#ifdef SCO
|
||||
-#define MAXPATHLEN 1024
|
||||
+#include <limits.h>
|
||||
+#define MAXPATHLEN PATH_MAX
|
||||
#endif
|
||||
|
||||
#include <fcntl.h>
|
||||
diff -up mozilla/js/src/jsfile.c.old mozilla/js/src/jsfile.c
|
||||
--- mozilla/js/src/jsfile.c.old 2006-07-26 20:55:08.000000000 +0200
|
||||
+++ mozilla/js/src/jsfile.c 2007-09-25 18:22:52.000000000 +0200
|
||||
@@ -105,7 +105,8 @@
|
||||
#define utfstring "binary"
|
||||
#define unicodestring "unicode"
|
||||
|
||||
-#define MAX_PATH_LENGTH 1024
|
||||
+#include <limits.h>
|
||||
+#define MAX_PATH_LENGTH PATH_MAX
|
||||
#define MODE_SIZE 256
|
||||
#define NUMBER_SIZE 32
|
||||
#define MAX_LINE_LENGTH 256
|
||||
diff -up mozilla/xpcom/typelib/xpidl/xpidl_java.c.old mozilla/xpcom/typelib/xpidl/xpidl_java.c
|
||||
--- mozilla/xpcom/typelib/xpidl/xpidl_java.c.old 2007-09-25 18:38:52.000000000 +0200
|
||||
+++ mozilla/xpcom/typelib/xpidl/xpidl_java.c 2007-09-25 18:39:17.000000000 +0200
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "xpidl.h"
|
||||
#include <ctype.h>
|
||||
#include <glib.h>
|
||||
+#include <limits.h>
|
||||
|
||||
#ifdef XP_WIN
|
||||
#include <windef.h>
|
||||
diff -up mozilla/widget/src/xremoteclient/XRemoteClient.cpp.old mozilla/widget/src/xremoteclient/XRemoteClient.cpp
|
||||
--- mozilla/widget/src/xremoteclient/XRemoteClient.cpp.old 2007-09-25 18:14:08.000000000 +0200
|
||||
+++ mozilla/widget/src/xremoteclient/XRemoteClient.cpp 2007-09-25 18:36:55.000000000 +0200
|
||||
@@ -76,7 +76,8 @@
|
||||
#endif
|
||||
|
||||
#ifndef MAX_PATH
|
||||
-#define MAX_PATH 1024
|
||||
+#include <limits.h>
|
||||
+#define MAX_PATH PATH_MAX
|
||||
#endif
|
||||
|
||||
#define ARRAY_LENGTH(array_) (sizeof(array_)/sizeof(array_[0]))
|
||||
diff -up mozilla/modules/libreg/src/reg.c.old mozilla/modules/libreg/src/reg.c
|
||||
--- mozilla/modules/libreg/src/reg.c.old 2007-09-25 18:25:02.000000000 +0200
|
||||
+++ mozilla/modules/libreg/src/reg.c 2007-09-25 18:27:46.000000000 +0200
|
||||
@@ -96,7 +96,8 @@
|
||||
#define MAX_PATH PATH_MAX
|
||||
#elif defined(XP_UNIX)
|
||||
#ifndef MAX_PATH
|
||||
-#define MAX_PATH 1024
|
||||
+#include <limits.h>
|
||||
+#define MAX_PATH PATH_MAX
|
||||
#endif
|
||||
#elif defined(XP_OS2)
|
||||
#ifndef MAX_PATH
|
||||
diff -up mozilla/config/pathsub.h.old mozilla/config/pathsub.h
|
||||
--- mozilla/config/pathsub.h.old 2004-04-18 16:17:25.000000000 +0200
|
||||
+++ mozilla/config/pathsub.h 2007-09-25 18:48:13.000000000 +0200
|
||||
@@ -46,7 +46,7 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef PATH_MAX
|
||||
-#define PATH_MAX 1024
|
||||
+#error "PATH_MAX is not defined!"
|
||||
#endif
|
||||
|
||||
/*
|
||||
diff -up mozilla/modules/libjar/nsZipArchive.cpp.old mozilla/modules/libjar/nsZipArchive.cpp
|
||||
--- mozilla/modules/libjar/nsZipArchive.cpp.old 2006-09-13 20:32:37.000000000 +0200
|
||||
+++ mozilla/modules/libjar/nsZipArchive.cpp 2007-09-25 18:51:00.000000000 +0200
|
||||
@@ -121,7 +121,7 @@ char * strdup(const char *src)
|
||||
# define S_IFLNK 0120000
|
||||
# endif
|
||||
# ifndef PATH_MAX
|
||||
-# define PATH_MAX 1024
|
||||
+# include <limits.h>
|
||||
# endif
|
||||
#endif /* XP_UNIX */
|
||||
|
||||
diff -up mozilla/nsprpub/config/pathsub.h.old mozilla/nsprpub/config/pathsub.h
|
||||
--- mozilla/nsprpub/config/pathsub.h.old 2004-04-25 17:00:34.000000000 +0200
|
||||
+++ mozilla/nsprpub/config/pathsub.h 2007-09-25 18:57:51.000000000 +0200
|
||||
@@ -50,7 +50,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
-#define PATH_MAX 1024
|
||||
+#error "PATH_MAX is not defined!"
|
||||
#endif
|
||||
|
||||
/*
|
||||
diff -up mozilla/security/coreconf/nsinstall/pathsub.h.old mozilla/security/coreconf/nsinstall/pathsub.h
|
||||
--- mozilla/security/coreconf/nsinstall/pathsub.h.old 2004-04-25 17:02:18.000000000 +0200
|
||||
+++ mozilla/security/coreconf/nsinstall/pathsub.h 2007-09-25 19:00:35.000000000 +0200
|
||||
@@ -49,7 +49,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
-#define PATH_MAX 1024
|
||||
+#error "PATH_MAX is not defined!"
|
||||
#endif
|
||||
|
||||
/*
|
@ -57,8 +57,7 @@ cmdname=`basename $0`
|
||||
MOZ_DIST_BIN="%PREFIX"
|
||||
MOZ_DIST_LIB="%PROGDIR"
|
||||
MOZ_APPNAME="%APPNAME"
|
||||
MOZ_PROFILE="%PROFILE"
|
||||
MOZ_PROGRAM="$MOZ_DIST_LIB/$MOZ_APPNAME-bin"
|
||||
MOZ_PROGRAM="$MOZ_DIST_LIB/$MOZ_APPNAME"
|
||||
|
||||
mozilla_lib=`file $MOZ_PROGRAM`
|
||||
LIB=lib
|
||||
@ -69,53 +68,15 @@ if [ ! -d $BROWSER_PLUGIN_DIR ]; then
|
||||
BROWSER_PLUGIN_DIR=/opt/netscape/plugins
|
||||
fi
|
||||
|
||||
# Force use of GTK+ 2.0 for Flash player to get better performance
|
||||
# (no impact when using mozilla gtk1 build
|
||||
#
|
||||
export FLASH_GTK_LIBRARY=libgtk-x11-2.0.so.0
|
||||
|
||||
# ignore composite extension (needed for Flash)
|
||||
export XLIB_SKIP_ARGB_VISUALS=1
|
||||
|
||||
# needed for SUN Java under Xorg >= 7.2
|
||||
export LIBXCB_ALLOW_SLOPPY_LOCK=1
|
||||
|
||||
# Pango support
|
||||
if [ -z "$MOZ_ENABLE_PANGO" -a -z "$MOZ_DISABLE_PANGO" ]; then
|
||||
case "${LC_ALL-${LC_CTYPE-${LANG-en_US}}}" in
|
||||
bn*|gu*|hi*|ja*|km*|kn*|ml*|mr*|pa*|ta*|te*) # list of languages which need pango
|
||||
;;
|
||||
*)
|
||||
export MOZ_DISABLE_PANGO=1 # disable by default
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
##
|
||||
## Set MOZILLA_FIVE_HOME
|
||||
##
|
||||
MOZILLA_FIVE_HOME="$MOZ_DIST_LIB"
|
||||
export MOZILLA_FIVE_HOME
|
||||
|
||||
##
|
||||
## Set LD_LIBRARY_PATH
|
||||
##
|
||||
if [ "$LD_LIBRARY_PATH" ]
|
||||
then
|
||||
LD_LIBRARY_PATH=$MOZ_DIST_LIB/plugins:$MOZ_DIST_LIB:$LD_LIBRARY_PATH
|
||||
else
|
||||
LD_LIBRARY_PATH=$MOZ_DIST_LIB/plugins:$MOZ_DIST_LIB
|
||||
fi
|
||||
export LD_LIBRARY_PATH
|
||||
|
||||
## Make sure that we set the plugin path for backwards compatibility
|
||||
## Set MOZ_PLUGIN_PATH to $HOME/.mozilla/plugins if not set
|
||||
##
|
||||
if [ -z "$MOZ_PLUGIN_PATH" ]; then
|
||||
export MOZ_PLUGIN_PATH=$MOZILLA_FIVE_HOME/plugins:$BROWSER_PLUGIN_DIR
|
||||
if [ "$HOME" ] ; then
|
||||
export MOZ_PLUGIN_PATH=$HOME/$MOZ_PROFILE/plugins:$MOZ_PLUGIN_PATH
|
||||
fi
|
||||
export MOZ_PLUGIN_PATH=$BROWSER_PLUGIN_DIR
|
||||
else
|
||||
# make sure that BROWSER_PLUGIN_DIR is in MOZ_PLUGIN_PATH
|
||||
echo "$MOZ_PLUGIN_PATH" | grep "$BROWSER_PLUGIN_DIR" 2>&1 >/dev/null
|
||||
@ -125,46 +86,6 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
moz_pis_startstop_scripts()
|
||||
{
|
||||
MOZ_USER_DIR="$MOZ_PROFILE"
|
||||
# MOZ_PIS_ is the name space for "Mozilla Plugable Init Scripts"
|
||||
# These variables and there meaning are specified in
|
||||
# mozilla/xpfe/bootstrap/init.d/README
|
||||
MOZ_PIS_API=2
|
||||
MOZ_PIS_MOZBINDIR="$MOZ_DIST_LIB"
|
||||
MOZ_PIS_SESSION_PID="$$"
|
||||
MOZ_PIS_USER_DIR="${MOZ_USER_DIR}"
|
||||
export MOZ_PIS_API MOZ_PIS_MOZBINDIR MOZ_PIS_SESSION_PID MOZ_PIS_USER_DIR
|
||||
|
||||
case "${1}" in
|
||||
"start")
|
||||
for curr_pis in "$MOZ_DIST_LIB/init.d"/S* "${HOME}/${MOZ_USER_DIR}/init.d"/S* ; do
|
||||
if [ -x "${curr_pis}" ] ; then
|
||||
case "${curr_pis}" in
|
||||
*.sh) . "${curr_pis}" ;;
|
||||
*) "${curr_pis}" "start" ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
;;
|
||||
"stop")
|
||||
for curr_pis in "${HOME}/${MOZ_USER_DIR}/init.d"/K* "$MOZ_DIST_LIB/init.d"/K* ; do
|
||||
if [ -x "${curr_pis}" ] ; then
|
||||
case "${curr_pis}" in
|
||||
*.sh) . "${curr_pis}" ;;
|
||||
*) "${curr_pis}" "stop" ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
;;
|
||||
*)
|
||||
echo 1>&2 "$0: Internal error in moz_pis_startstop_scripts."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
moz_debug=0
|
||||
script_args=""
|
||||
pass_arg_count=0
|
||||
@ -191,9 +112,6 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
## Start addon scripts
|
||||
moz_pis_startstop_scripts "start"
|
||||
|
||||
if [ $moz_debug -eq 1 ]; then
|
||||
tmpfile=`mktemp /tmp/mozargs.XXXXXX` || { echo "Cannot create temporary file" >&2; exit 1; }
|
||||
trap " [ -f \"$tmpfile\" ] && /bin/rm -f -- \"$tmpfile\"" 0 1 2 3 13 15
|
||||
@ -201,15 +119,8 @@ if [ $moz_debug -eq 1 ]; then
|
||||
echo "$moz_debugger $MOZ_PROGRAM -x $tmpfile"
|
||||
$moz_debugger "$MOZ_PROGRAM" -x $tmpfile
|
||||
else
|
||||
if [ -d /proc/asound -a -e /usr/$LIB/libaoss.so ]; then
|
||||
export LD_PRELOAD=/usr/\$LIB/libaoss.so${LD_PRELOAD:+:$LD_PRELOAD}
|
||||
fi
|
||||
$MOZ_PROGRAM "$@"
|
||||
fi
|
||||
exitcode=$?
|
||||
unset LD_PRELOAD
|
||||
|
||||
## Stop addon scripts
|
||||
moz_pis_startstop_scripts "stop"
|
||||
|
||||
exit $exitcode
|
||||
|
@ -1,17 +0,0 @@
|
||||
--- nsprpub/pr/src/misc/Makefile.in.foo Wed Jun 11 15:42:57 2003
|
||||
+++ nsprpub/pr/src/misc/Makefile.in Wed Jun 11 15:42:49 2003
|
||||
@@ -82,6 +82,14 @@
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
+NONOPT_CFLAGS=$(filter-out -O%, $(CFLAGS))
|
||||
+
|
||||
+ifeq ($(OS_ARCH),Linux)
|
||||
+$(OBJDIR)/prdtoa.$(OBJ_SUFFIX): prdtoa.c
|
||||
+ @$(MAKE_OBJDIR)
|
||||
+ $(CC) -o $@ -c $(NONOPT_CFLAGS) -ffloat-store $<
|
||||
+endif
|
||||
+
|
||||
#
|
||||
# Generate prerr.h, prerr.c, and prerr.properties from prerr.et.
|
||||
#
|
@ -1,22 +0,0 @@
|
||||
From: Wolfgang Rosenauer <stark@suse.de>
|
||||
Subject: NSS doesn't inherit CFLAGS
|
||||
References: https://bugzilla.mozilla.org/show_bug.cgi?id=101249
|
||||
Description:
|
||||
CFLAGS are not taken from mozilla build
|
||||
|
||||
Index: security/manager/Makefile.in
|
||||
================================================================================
|
||||
--- security/manager/Makefile.in
|
||||
+++ security/manager/Makefile.in
|
||||
@@ -154,7 +154,10 @@
|
||||
ifneq ($(ABS_topsrcdir),$(MOZ_BUILD_ROOT))
|
||||
DEFAULT_GMAKE_FLAGS += BUILD_TREE=$(MOZ_BUILD_ROOT)
|
||||
endif
|
||||
-ifndef MOZ_DEBUG
|
||||
+ifdef MOZ_DEBUG
|
||||
+DEFAULT_GMAKE_FLAGS += OPTIMIZER="$(MOZ_DEBUG_FLAGS)"
|
||||
+else
|
||||
+DEFAULT_GMAKE_FLAGS += OPTIMIZER="$(MOZ_OPTIMIZE_FLAGS)"
|
||||
DEFAULT_GMAKE_FLAGS += BUILD_OPT=1
|
||||
endif
|
||||
ifdef GNU_CC
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a227d241e6e9f588871e23af27097c099cddfd345387f843c847ca4f9222f9ea
|
||||
size 608690
|
@ -1,29 +0,0 @@
|
||||
From: Wolfgang Rosenauer <stark@suse.de>
|
||||
Subject: make pagesize postscript DSC conform
|
||||
References:
|
||||
http://www.cups.org/str.php?L1542
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=334485
|
||||
|
||||
Index: gfx/src/ps/nsPostScriptObj.cpp
|
||||
================================================================================
|
||||
--- gfx/src/ps/nsPostScriptObj.cpp
|
||||
+++ gfx/src/ps/nsPostScriptObj.cpp
|
||||
@@ -466,6 +466,7 @@
|
||||
|
||||
// Tell the printer what size paper it should use
|
||||
fprintf(f,
|
||||
+ "%%%%BeginFeature: *PageSize %s\n"
|
||||
"/setpagedevice where\n" // Test for the feature
|
||||
"{ pop 2 dict\n"
|
||||
" dup /PageSize [ %s %s ] put\n" // Paper dimensions
|
||||
@@ -473,7 +474,9 @@
|
||||
" dup /PageSize 3 put\n" // Select the nearest page size to fit
|
||||
" put\n"
|
||||
" setpagedevice\n" // Install settings
|
||||
- "} if\n",
|
||||
+ "} if\n"
|
||||
+ "%%%%EndFeature\n",
|
||||
+ mPrintSetup->paper_name,
|
||||
fpCString(NSTwipsToFloatPoints(paper_width)).get(),
|
||||
fpCString(NSTwipsToFloatPoints(paper_height)).get());
|
||||
|
180
proxy-dev.patch
180
proxy-dev.patch
@ -1,180 +0,0 @@
|
||||
From: Robert O'Callahan <rocallahan@novell.com>
|
||||
Subject: proxy.pac: host resolution error
|
||||
References:
|
||||
https://bugzilla.novell.com/show_bug.cgi?id=196506
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=347307
|
||||
|
||||
diff --git a/netwerk/base/src/nsProxyAutoConfig.js b/netwerk/base/src/nsProxyAutoConfig.js
|
||||
index 6a34044..2186502 100644
|
||||
--- a/netwerk/base/src/nsProxyAutoConfig.js
|
||||
+++ b/netwerk/base/src/nsProxyAutoConfig.js
|
||||
@@ -50,7 +50,7 @@ const kPAC_CID = Components.ID("{63ac8c66-1dd2-11b2-b070-84d00d3eaece}");
|
||||
|
||||
const nsISupports = Components.interfaces.nsISupports;
|
||||
const nsIProxyAutoConfig = Components.interfaces.nsIProxyAutoConfig;
|
||||
-const nsIDNSService = Components.interfaces.nsIDNSService;
|
||||
+const nsPIDNSService = Components.interfaces.nsPIDNSService;
|
||||
|
||||
// implementor of nsIProxyAutoConfig
|
||||
function nsProxyAutoConfig() {};
|
||||
@@ -114,7 +114,7 @@ function proxyAlert(msg) {
|
||||
// wrapper for getting local IP address called by PAC file
|
||||
function myIpAddress() {
|
||||
try {
|
||||
- return dns.resolve(dns.myHostName, 0).getNextAddrAsString();
|
||||
+ return dns.getNetworkAddrAsString();
|
||||
} catch (e) {
|
||||
return '127.0.0.1';
|
||||
}
|
||||
@@ -176,7 +176,7 @@ function NSGetModule(compMgr, fileSpec) {
|
||||
}
|
||||
|
||||
var pac = new nsProxyAutoConfig() ;
|
||||
-var dns = Components.classes[kDNS_CONTRACTID].getService(nsIDNSService);
|
||||
+var dns = Components.classes[kDNS_CONTRACTID].getService(nsPIDNSService);
|
||||
|
||||
var pacUtils =
|
||||
"function dnsDomainIs(host, domain) {\n" +
|
||||
diff --git a/netwerk/dns/public/nsPIDNSService.idl b/netwerk/dns/public/nsPIDNSService.idl
|
||||
index e0eea6d..1abb223 100644
|
||||
--- a/netwerk/dns/public/nsPIDNSService.idl
|
||||
+++ b/netwerk/dns/public/nsPIDNSService.idl
|
||||
@@ -58,4 +58,11 @@ interface nsPIDNSService : nsIDNSService
|
||||
* this method.
|
||||
*/
|
||||
void shutdown();
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the IP address of the machine that is most suitable for
|
||||
+ * identifying the machine's network. Favour VPN addresses above
|
||||
+ * wired/wireless addresses above 127.x.x.x addresses.
|
||||
+ */
|
||||
+ ACString getNetworkAddrAsString();
|
||||
};
|
||||
diff --git a/netwerk/dns/src/nsDNSService2.cpp b/netwerk/dns/src/nsDNSService2.cpp
|
||||
index f38e0c1..e928a76 100644
|
||||
--- a/netwerk/dns/src/nsDNSService2.cpp
|
||||
+++ b/netwerk/dns/src/nsDNSService2.cpp
|
||||
@@ -56,6 +56,11 @@
|
||||
#include "prio.h"
|
||||
#include "plstr.h"
|
||||
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/socket.h>
|
||||
+#include <ifaddrs.h>
|
||||
+#include <net/if.h>
|
||||
+
|
||||
static const char kPrefDnsCacheEntries[] = "network.dnsCacheEntries";
|
||||
static const char kPrefDnsCacheExpiration[] = "network.dnsCacheExpiration";
|
||||
static const char kPrefEnableIDN[] = "network.enableIDN";
|
||||
@@ -135,6 +140,18 @@ nsDNSRecord::GetNextAddr(PRUint16 port, PRNetAddr *addr)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
+static nsresult
|
||||
+AddrToString(PRNetAddr* aAddr, nsACString& aResult)
|
||||
+{
|
||||
+ char buf[64];
|
||||
+ if (PR_NetAddrToString(aAddr, buf, sizeof(buf)) == PR_SUCCESS) {
|
||||
+ aResult.Assign(buf);
|
||||
+ return NS_OK;
|
||||
+ }
|
||||
+ NS_ERROR("PR_NetAddrToString failed unexpectedly");
|
||||
+ return NS_ERROR_FAILURE; // conversion failed for some reason
|
||||
+}
|
||||
+
|
||||
NS_IMETHODIMP
|
||||
nsDNSRecord::GetNextAddrAsString(nsACString &result)
|
||||
{
|
||||
@@ -142,13 +159,7 @@ nsDNSRecord::GetNextAddrAsString(nsACString &result)
|
||||
nsresult rv = GetNextAddr(0, &addr);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
- char buf[64];
|
||||
- if (PR_NetAddrToString(&addr, buf, sizeof(buf)) == PR_SUCCESS) {
|
||||
- result.Assign(buf);
|
||||
- return NS_OK;
|
||||
- }
|
||||
- NS_ERROR("PR_NetAddrToString failed unexpectedly");
|
||||
- return NS_ERROR_FAILURE; // conversion failed for some reason
|
||||
+ return AddrToString(&addr, result);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@@ -580,3 +591,76 @@ nsDNSService::GetAFForLookup(const nsACString &host)
|
||||
|
||||
return af;
|
||||
}
|
||||
+
|
||||
+static PRInt32
|
||||
+GetScoreForInterface(struct ifaddrs* aInterface)
|
||||
+{
|
||||
+ // Interface must be up
|
||||
+ if (!(aInterface->ifa_flags & IFF_UP))
|
||||
+ return 0;
|
||||
+ // Interface must be configured
|
||||
+ if (!(aInterface->ifa_flags & IFF_RUNNING))
|
||||
+ return 0;
|
||||
+
|
||||
+ // Interface must have an address
|
||||
+ if (aInterface->ifa_addr == NULL)
|
||||
+ return 0;
|
||||
+
|
||||
+ // Interface must have an address
|
||||
+ if (aInterface->ifa_addr == NULL)
|
||||
+ return 0;
|
||||
+
|
||||
+ // Only look at IP interfaces
|
||||
+ sa_family_t type = aInterface->ifa_addr->sa_family;
|
||||
+ if (type != AF_INET && type != AF_INET6)
|
||||
+ return 0;
|
||||
+
|
||||
+ // Loopback interfaces get the lowest score
|
||||
+ if (aInterface->ifa_flags & IFF_LOOPBACK)
|
||||
+ return 1;
|
||||
+
|
||||
+ if (strchr(aInterface->ifa_name, ':')) {
|
||||
+ // guess that it's probably a VPN address
|
||||
+ return 3;
|
||||
+ }
|
||||
+
|
||||
+ // Regular interface
|
||||
+ return 2;
|
||||
+}
|
||||
+
|
||||
+nsresult
|
||||
+SockaddrToString(struct sockaddr* aAddr, nsACString& aResult)
|
||||
+{
|
||||
+ PRNetAddr* addr = NS_REINTERPRET_CAST(PRNetAddr*, aAddr);
|
||||
+ return AddrToString(addr, aResult);
|
||||
+}
|
||||
+
|
||||
+NS_IMETHODIMP
|
||||
+nsDNSService::GetNetworkAddrAsString(nsACString& aResult)
|
||||
+{
|
||||
+ aResult.AssignLiteral("127.0.0.1");
|
||||
+
|
||||
+ struct ifaddrs* addrs;
|
||||
+ if (getifaddrs(&addrs) < 0)
|
||||
+ return NS_OK;
|
||||
+
|
||||
+ struct ifaddrs* bestAddr = nsnull;
|
||||
+ PRInt32 bestScore = 0;
|
||||
+ struct ifaddrs* addr;
|
||||
+ for (addr = addrs; addr; addr = addr->ifa_next) {
|
||||
+ PRInt32 score = GetScoreForInterface(addr);
|
||||
+ if (score > 0 && (!bestAddr || score > bestScore)) {
|
||||
+ bestAddr = addr;
|
||||
+ bestScore = score;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!bestAddr) {
|
||||
+ freeifaddrs(addrs);
|
||||
+ return NS_OK;
|
||||
+ }
|
||||
+
|
||||
+ nsresult rv = SockaddrToString(bestAddr->ifa_addr, aResult);
|
||||
+ freeifaddrs(addrs);
|
||||
+ return rv;
|
||||
+}
|
21
rpath.patch
21
rpath.patch
@ -1,21 +0,0 @@
|
||||
Index: browser/app/Makefile.in
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/browser/app/Makefile.in,v
|
||||
retrieving revision 1.52.2.2.2.19.2.1
|
||||
diff -u -p -6 -r1.52.2.2.2.19.2.1 Makefile.in
|
||||
--- browser/app/Makefile.in 8 Apr 2005 23:29:22 -0000 1.52.2.2.2.19.2.1
|
||||
+++ browser/app/Makefile.in 18 Aug 2005 10:20:26 -0000
|
||||
@@ -72,12 +72,13 @@ TK_LIBS := -framework Cocoa $(TK_LIBS)
|
||||
endif
|
||||
|
||||
LIBS = \
|
||||
$(STATIC_COMPONENTS_LINKER_PATH) \
|
||||
$(EXTRA_DSO_LIBS) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) \
|
||||
+ $(RPATH) \
|
||||
$(MOZ_JS_LIBS) \
|
||||
$(XPCOM_LIBS) \
|
||||
$(NSPR_LIBS) \
|
||||
$(TK_LIBS) \
|
||||
$(NULL)
|
||||
|
@ -1,51 +0,0 @@
|
||||
From: Wolfgang Rosenauer <stark@suse.de>
|
||||
Subject: choose default theme at first startup according to the Desktop Env
|
||||
References:
|
||||
|
||||
|
||||
Index: browser/app/profile/firefox.js
|
||||
================================================================================
|
||||
--- browser/app/profile/firefox.js
|
||||
+++ browser/app/profile/firefox.js
|
||||
@@ -102,7 +102,7 @@
|
||||
pref("keyword.URL", "chrome://browser-region/locale/region.properties");
|
||||
|
||||
pref("general.useragent.locale", "@AB_CD@");
|
||||
-pref("general.skins.selectedSkin", "classic/1.0");
|
||||
+//pref("general.skins.selectedSkin", "classic/1.0");
|
||||
pref("general.useragent.extra.firefox", "@APP_UA_NAME@/@APP_VERSION@");
|
||||
|
||||
pref("general.smoothScroll", false);
|
||||
--- modules/libpref/src/nsPrefService.cpp
|
||||
+++ modules/libpref/src/nsPrefService.cpp
|
||||
@@ -36,6 +36,7 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
+#include <string.h>
|
||||
#include "nsPrefService.h"
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
@@ -207,11 +208,22 @@
|
||||
NS_IMETHODIMP nsPrefService::ReadUserPrefs(nsIFile *aFile)
|
||||
{
|
||||
nsresult rv;
|
||||
+ PRBool rv2;
|
||||
|
||||
if (nsnull == aFile) {
|
||||
rv = UseDefaultPrefFile();
|
||||
UseUserPrefFile();
|
||||
|
||||
+ rv2 = PREF_HasUserPref("general.skins.selectedSkin");
|
||||
+ if (!rv2) {
|
||||
+ if (getenv("KDE_FULL_SESSION"))
|
||||
+ PREF_SetCharPref("general.skins.selectedSkin", "plastikfox");
|
||||
+ else if (getenv("DESKTOP_SESSION") && !strcmp("gnome", getenv("DESKTOP_SESSION")))
|
||||
+ PREF_SetCharPref("general.skins.selectedSkin", "tango");
|
||||
+ else
|
||||
+ PREF_SetCharPref("general.skins.selectedSkin", "classic/1.0");
|
||||
+ }
|
||||
+
|
||||
NotifyServiceObservers(NS_PREFSERVICE_READ_TOPIC_ID);
|
||||
|
||||
} else {
|
1214
startup.patch
1214
startup.patch
File diff suppressed because it is too large
Load Diff
@ -1,58 +0,0 @@
|
||||
Index: toolkit/mozapps/extensions/src/nsExtensionManager.js.in
|
||||
================================================================================
|
||||
--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in
|
||||
+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in
|
||||
@@ -119,6 +119,7 @@
|
||||
|
||||
const KEY_APP_PROFILE = "app-profile";
|
||||
const KEY_APP_GLOBAL = "app-global";
|
||||
+const KEY_APP_SYSTEM = "app-system";
|
||||
|
||||
const CATEGORY_INSTALL_LOCATIONS = "extension-install-locations";
|
||||
|
||||
@@ -2676,6 +2677,16 @@
|
||||
priority);
|
||||
InstallLocations.put(profileLocation);
|
||||
|
||||
+ // Register App-System Install Location
|
||||
+ try {
|
||||
+ var appSystemExtensions = getDirNoCreate("DrvD", ["usr","lib","browser-extensions","firefox"]);
|
||||
+ var priority = nsIInstallLocation.PRIORITY_APP_PROFILE - 1;
|
||||
+ var systemLocation = new DirectoryInstallLocation(KEY_APP_SYSTEM,
|
||||
+ appSystemExtensions, true,
|
||||
+ priority);
|
||||
+ InstallLocations.put(systemLocation);
|
||||
+ } catch (e) {}
|
||||
+
|
||||
#ifdef XP_WIN
|
||||
// Register HKEY_LOCAL_MACHINE Install Location
|
||||
InstallLocations.put(
|
||||
@@ -3852,7 +3863,7 @@
|
||||
|
||||
// Prepare themes for installation
|
||||
// Only enumerate directories in the app-profile and app-global locations.
|
||||
- var locations = [KEY_APP_PROFILE, KEY_APP_GLOBAL];
|
||||
+ var locations = [KEY_APP_PROFILE, KEY_APP_GLOBAL, KEY_APP_SYSTEM];
|
||||
for (var i = 0; i < locations.length; ++i) {
|
||||
var location = InstallLocations.get(locations[i]);
|
||||
if (!location.canAccess)
|
||||
@@ -3918,7 +3929,8 @@
|
||||
var items = PendingOperations.getOperations(OP_NEEDS_INSTALL);
|
||||
for (i = items.length - 1; i >= 0; --i) {
|
||||
if (items[i].locationKey == KEY_APP_PROFILE ||
|
||||
- items[i].locationKey == KEY_APP_GLOBAL)
|
||||
+ items[i].locationKey == KEY_APP_GLOBAL ||
|
||||
+ items[i].locationKey == KEY_APP_SYSTEM)
|
||||
itemsToCheck.push(items[i].id);
|
||||
}
|
||||
this._finishOperations();
|
||||
@@ -4903,7 +4915,8 @@
|
||||
}
|
||||
}
|
||||
else if (installLocation.name == KEY_APP_PROFILE ||
|
||||
- installLocation.name == KEY_APP_GLOBAL) {
|
||||
+ installLocation.name == KEY_APP_GLOBAL ||
|
||||
+ installLocation.name == KEY_APP_SYSTEM) {
|
||||
// Check for a pointer file and remove it if it exists
|
||||
var pointerFile = installLocation.location.clone();
|
||||
pointerFile.append(id);
|
@ -1,894 +0,0 @@
|
||||
Index: netwerk/base/public/nsISystemProxySettings.idl
|
||||
================================================================================
|
||||
--- allmakefiles.sh
|
||||
+++ allmakefiles.sh
|
||||
@@ -984,6 +984,7 @@
|
||||
toolkit/components/downloads/src/Makefile
|
||||
toolkit/components/filepicker/Makefile
|
||||
toolkit/components/gnome/Makefile
|
||||
+toolkit/components/unixproxy/Makefile
|
||||
toolkit/components/help/Makefile
|
||||
toolkit/components/history/Makefile
|
||||
toolkit/components/history/public/Makefile
|
||||
--- browser/components/preferences/connection.xul
|
||||
+++ browser/components/preferences/connection.xul
|
||||
@@ -38,7 +38,12 @@
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
-<!DOCTYPE prefwindow SYSTEM "chrome://browser/locale/preferences/connection.dtd">
|
||||
+<!DOCTYPE prefwindow [
|
||||
+ <!ENTITY % connectionDTD SYSTEM "chrome://browser/locale/preferences/connection.dtd">
|
||||
+ %connectionDTD;
|
||||
+ <!ENTITY % mainDTD SYSTEM "chrome://browser/locale/preferences/main.dtd">
|
||||
+ %mainDTD;
|
||||
+]>
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/"?>
|
||||
|
||||
@@ -99,6 +104,7 @@
|
||||
<radiogroup id="networkProxyType" preference="network.proxy.type"
|
||||
onsyncfrompreference="return gConnectionsDialog.readProxyType();">
|
||||
<radio value="0" label="&directTypeRadio.label;" accesskey="&directTypeRadio.accesskey;"/>
|
||||
+ <radio value="5" label="&systemDefaults.label;" />
|
||||
<radio value="4" label="&WPADTypeRadio.label;" accesskey="&WPADTypeRadio.accesskey;"/>
|
||||
<radio value="1" label="&manualTypeRadio.label;" accesskey="&manualTypeRadio.accesskey;"/>
|
||||
<grid class="indent" flex="1">
|
||||
--- browser/installer/unix/packages-static
|
||||
+++ browser/installer/unix/packages-static
|
||||
@@ -51,6 +51,7 @@
|
||||
bin/xpicleanup
|
||||
|
||||
; [Components]
|
||||
+bin/components/libunixproxy.so
|
||||
bin/components/accessibility.xpt
|
||||
bin/components/accessibility-atk.xpt
|
||||
bin/components/appshell.xpt
|
||||
--- netwerk/base/public/Makefile.in
|
||||
+++ netwerk/base/public/Makefile.in
|
||||
@@ -98,6 +98,7 @@
|
||||
nsIStreamTransportService.idl \
|
||||
nsIStreamLoader.idl \
|
||||
nsISyncStreamListener.idl \
|
||||
+ nsISystemProxySettings.idl \
|
||||
nsIUnicharStreamLoader.idl \
|
||||
nsIStandardURL.idl \
|
||||
nsIURLParser.idl \
|
||||
--- netwerk/base/public/nsISystemProxySettings.idl
|
||||
+++ netwerk/base/public/nsISystemProxySettings.idl
|
||||
@@ -0,0 +1,65 @@
|
||||
+/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
+/* ***** BEGIN LICENSE BLOCK *****
|
||||
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
+ *
|
||||
+ * The contents of this file are subject to the Mozilla Public License Version
|
||||
+ * 1.1 (the "License"); you may not use this file except in compliance with
|
||||
+ * the License. You may obtain a copy of the License at
|
||||
+ * http://www.mozilla.org/MPL/
|
||||
+ *
|
||||
+ * Software distributed under the License is distributed on an "AS IS" basis,
|
||||
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
+ * for the specific language governing rights and limitations under the
|
||||
+ * License.
|
||||
+ *
|
||||
+ * The Original Code is Novell code.
|
||||
+ *
|
||||
+ * The Initial Developer of the Original Code is Novell.
|
||||
+ * Portions created by the Initial Developer are Copyright (C) 2005
|
||||
+ * the Initial Developer. All Rights Reserved.
|
||||
+ *
|
||||
+ * Contributor(s):
|
||||
+ * Robert O'Callahan (rocallahan@novell.com)
|
||||
+ *
|
||||
+ * Alternatively, the contents of this file may be used under the terms of
|
||||
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
+ * in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
+ * of those above. If you wish to allow use of your version of this file only
|
||||
+ * under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
+ * use your version of this file under the terms of the MPL, indicate your
|
||||
+ * decision by deleting the provisions above and replace them with the notice
|
||||
+ * and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
+ * the provisions above, a recipient may use your version of this file under
|
||||
+ * the terms of any one of the MPL, the GPL or the LGPL.
|
||||
+ *
|
||||
+ * ***** END LICENSE BLOCK ***** */
|
||||
+
|
||||
+#include "nsISupports.idl"
|
||||
+#include "nsIURI.idl"
|
||||
+
|
||||
+%{C++
|
||||
+#define NS_SYSTEMPROXYSETTINGS_CONTRACTID "@mozilla.org/system-proxy-settings;1"
|
||||
+%}
|
||||
+
|
||||
+/**
|
||||
+ * This interface allows the proxy code to use platform-specific proxy
|
||||
+ * settings when the proxy preference is set to "automatic discovery". If it can
|
||||
+ * load a service with the above contract ID, it will use it to determine the
|
||||
+ * PAC file name. If no PAC file is specified then the service itself will behave
|
||||
+ * like a PAC file.
|
||||
+ */
|
||||
+[scriptable, uuid(a9f3ae38-b769-4e0b-9317-578388e326c9)]
|
||||
+interface nsISystemProxySettings : nsISupports
|
||||
+{
|
||||
+ /**
|
||||
+ * If non-empty, use this PAC file. If empty, call getProxyForURI instead.
|
||||
+ */
|
||||
+ readonly attribute AUTF8String PACURI;
|
||||
+
|
||||
+ /**
|
||||
+ * See nsIProxyAutoConfig::getProxyForURI; this function behaves exactly
|
||||
+ * the same way.
|
||||
+ */
|
||||
+ ACString getProxyForURI(in nsIURI aURI);
|
||||
+};
|
||||
--- netwerk/base/src/nsPACMan.h
|
||||
+++ netwerk/base/src/nsPACMan.h
|
||||
@@ -128,6 +128,14 @@
|
||||
*/
|
||||
PRBool IsLoading() { return mLoader != nsnull; }
|
||||
|
||||
+ /**
|
||||
+ * Returns true if the given URI matches the URI of our PAC file.
|
||||
+ */
|
||||
+ PRBool IsPACURI(nsIURI *uri) {
|
||||
+ PRBool result;
|
||||
+ return mPACURI && NS_SUCCEEDED(mPACURI->Equals(uri, &result)) && result;
|
||||
+ }
|
||||
+
|
||||
private:
|
||||
NS_DECL_NSISTREAMLOADEROBSERVER
|
||||
NS_DECL_NSIINTERFACEREQUESTOR
|
||||
@@ -163,14 +171,6 @@
|
||||
void OnLoadFailure();
|
||||
|
||||
/**
|
||||
- * Returns true if the given URI matches the URI of our PAC file.
|
||||
- */
|
||||
- PRBool IsPACURI(nsIURI *uri) {
|
||||
- PRBool result;
|
||||
- return mPACURI && NS_SUCCEEDED(mPACURI->Equals(uri, &result)) && result;
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
* Event fu for calling StartLoading asynchronously.
|
||||
*/
|
||||
PR_STATIC_CALLBACK(void *) LoadEvent_Handle(PLEvent *);
|
||||
--- netwerk/base/src/nsProtocolProxyService.cpp
|
||||
+++ netwerk/base/src/nsProtocolProxyService.cpp
|
||||
@@ -411,6 +411,12 @@
|
||||
mProxyConfig = NS_STATIC_CAST(ProxyConfig, type);
|
||||
reloadPAC = PR_TRUE;
|
||||
}
|
||||
+
|
||||
+ if (mProxyConfig == eProxyConfig_System) {
|
||||
+ mSystemProxySettings = do_GetService(NS_SYSTEMPROXYSETTINGS_CONTRACTID);
|
||||
+ } else {
|
||||
+ mSystemProxySettings = nsnull;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (!pref || !strcmp(pref, "network.proxy.http"))
|
||||
@@ -466,8 +472,10 @@
|
||||
LoadHostFilters(tempString.get());
|
||||
}
|
||||
|
||||
- // We're done if not using PAC or WPAD
|
||||
- if (mProxyConfig != eProxyConfig_PAC && mProxyConfig != eProxyConfig_WPAD)
|
||||
+ // We're done if not using something that could give us a PAC URL
|
||||
+ // (PAC, WPAD or System)
|
||||
+ if (mProxyConfig != eProxyConfig_PAC && mProxyConfig != eProxyConfig_WPAD &&
|
||||
+ mProxyConfig != eProxyConfig_System)
|
||||
return;
|
||||
|
||||
// OK, we need to reload the PAC file if:
|
||||
@@ -482,17 +490,21 @@
|
||||
if (mProxyConfig == eProxyConfig_PAC) {
|
||||
prefBranch->GetCharPref("network.proxy.autoconfig_url",
|
||||
getter_Copies(tempString));
|
||||
- }
|
||||
- else if (mProxyConfig == eProxyConfig_WPAD) {
|
||||
+ } else {
|
||||
// We diverge from the WPAD spec here in that we don't walk the
|
||||
// hosts's FQDN, stripping components until we hit a TLD. Doing so
|
||||
// is dangerous in the face of an incomplete list of TLDs, and TLDs
|
||||
// get added over time. We could consider doing only a single
|
||||
// substitution of the first component, if that proves to help
|
||||
// compatibility.
|
||||
- tempString.AssignLiteral("http://wpad/wpad.dat");
|
||||
+ if (mSystemProxySettings)
|
||||
+ mSystemProxySettings->GetPACURI(tempString);
|
||||
+ else
|
||||
+ tempString.AssignLiteral("http://wpad/wpad.dat");
|
||||
+ }
|
||||
+ if (!tempString.IsEmpty()) {
|
||||
+ ConfigureFromPAC(tempString);
|
||||
}
|
||||
- ConfigureFromPAC(tempString);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -901,13 +913,16 @@
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
- mFailedProxies.Clear();
|
||||
-
|
||||
nsCOMPtr<nsIURI> pacURI;
|
||||
nsresult rv = NS_NewURI(getter_AddRefs(pacURI), spec);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
+ if (mPACMan->IsPACURI(pacURI))
|
||||
+ return NS_OK;
|
||||
+
|
||||
+ mFailedProxies.Clear();
|
||||
+
|
||||
return mPACMan->LoadPACFromURI(pacURI);
|
||||
}
|
||||
|
||||
@@ -917,8 +932,10 @@
|
||||
nsresult aStatus,
|
||||
nsIProxyInfo **aResult)
|
||||
{
|
||||
- // We only support failover when a PAC file is configured.
|
||||
- if (mProxyConfig != eProxyConfig_PAC && mProxyConfig != eProxyConfig_WPAD)
|
||||
+ // We only support failover when a PAC file is configured, either
|
||||
+ // directly or via system settings
|
||||
+ if (mProxyConfig != eProxyConfig_PAC && mProxyConfig != eProxyConfig_WPAD &&
|
||||
+ mProxyConfig != eProxyConfig_System)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
// Verify that |aProxy| is one of our nsProxyInfo objects.
|
||||
@@ -1214,15 +1231,37 @@
|
||||
if (!(info.flags & nsIProtocolHandler::ALLOWS_PROXY))
|
||||
return NS_OK; // Can't proxy this (filters may not override)
|
||||
|
||||
+ if (mSystemProxySettings) {
|
||||
+ nsCAutoString PACURI;
|
||||
+ if (NS_SUCCEEDED(mSystemProxySettings->GetPACURI(PACURI)) &&
|
||||
+ !PACURI.IsEmpty()) {
|
||||
+ // Switch to new PAC file if that setting has changed. If the setting
|
||||
+ // hasn't changed, ConfigureFromPAC will exit early.
|
||||
+ nsresult rv = ConfigureFromPAC(PACURI);
|
||||
+ if (NS_FAILED(rv))
|
||||
+ return rv;
|
||||
+ } else {
|
||||
+ nsCAutoString proxy;
|
||||
+ nsresult rv = mSystemProxySettings->GetProxyForURI(uri, proxy);
|
||||
+ if (NS_SUCCEEDED(rv)) {
|
||||
+ ProcessPACString(proxy, result);
|
||||
+ return NS_OK;
|
||||
+ }
|
||||
+ // no proxy, stop search
|
||||
+ return NS_OK;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
// if proxies are enabled and this host:port combo is supposed to use a
|
||||
// proxy, check for a proxy.
|
||||
if (mProxyConfig == eProxyConfig_Direct ||
|
||||
(mProxyConfig == eProxyConfig_Manual &&
|
||||
!CanUseProxy(uri, info.defaultPort)))
|
||||
return NS_OK;
|
||||
-
|
||||
+
|
||||
// Proxy auto config magic...
|
||||
- if (mProxyConfig == eProxyConfig_PAC || mProxyConfig == eProxyConfig_WPAD) {
|
||||
+ if (mProxyConfig == eProxyConfig_PAC || mProxyConfig == eProxyConfig_WPAD ||
|
||||
+ mProxyConfig == eProxyConfig_System) {
|
||||
// Do not query PAC now.
|
||||
*usePAC = PR_TRUE;
|
||||
return NS_OK;
|
||||
--- netwerk/base/src/nsProtocolProxyService.h
|
||||
+++ netwerk/base/src/nsProtocolProxyService.h
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "nsPIProtocolProxyService.h"
|
||||
#include "nsIProtocolProxyFilter.h"
|
||||
#include "nsIProxyAutoConfig.h"
|
||||
+#include "nsISystemProxySettings.h"
|
||||
#include "nsIProxyInfo.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsDataHashtable.h"
|
||||
@@ -310,6 +311,7 @@
|
||||
eProxyConfig_PAC,
|
||||
eProxyConfig_Direct4x,
|
||||
eProxyConfig_WPAD,
|
||||
+ eProxyConfig_System, // use system proxy settings if available, otherwise WPAD
|
||||
eProxyConfig_Last
|
||||
};
|
||||
|
||||
@@ -371,6 +373,7 @@
|
||||
PRBool mSOCKSProxyRemoteDNS;
|
||||
|
||||
nsRefPtr<nsPACMan> mPACMan; // non-null if we are using PAC
|
||||
+ nsCOMPtr<nsISystemProxySettings> mSystemProxySettings;
|
||||
|
||||
PRTime mSessionStart;
|
||||
nsFailedProxyTable mFailedProxies;
|
||||
--- toolkit/components/gnome/nsGConfService.cpp
|
||||
+++ toolkit/components/gnome/nsGConfService.cpp
|
||||
@@ -39,6 +39,8 @@
|
||||
#include "nsGConfService.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsString.h"
|
||||
+#include "nsSupportsPrimitives.h"
|
||||
+#include "nsArray.h"
|
||||
|
||||
#include <gconf/gconf-client.h>
|
||||
|
||||
@@ -125,6 +127,37 @@
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
+nsGConfService::GetStringList(const nsACString &aKey, nsIArray** aResult)
|
||||
+{
|
||||
+ nsCOMPtr<nsIMutableArray> items;
|
||||
+ NS_NewArray(getter_AddRefs(items));
|
||||
+ if (!items)
|
||||
+ return NS_ERROR_OUT_OF_MEMORY;
|
||||
+
|
||||
+ GError* error = nsnull;
|
||||
+ GSList* list = gconf_client_get_list(mClient, PromiseFlatCString(aKey).get(),
|
||||
+ GCONF_VALUE_STRING, &error);
|
||||
+ if (error) {
|
||||
+ g_error_free(error);
|
||||
+ return NS_ERROR_FAILURE;
|
||||
+ }
|
||||
+
|
||||
+ for (GSList* l = list; l; l = l->next) {
|
||||
+ nsSupportsCStringImpl* obj = new nsSupportsCStringImpl();
|
||||
+ if (!obj) {
|
||||
+ g_slist_free(list);
|
||||
+ return NS_ERROR_OUT_OF_MEMORY;
|
||||
+ }
|
||||
+ obj->SetData(nsDependentCString((const char*)l->data));
|
||||
+ items->AppendElement(obj, PR_FALSE);
|
||||
+ }
|
||||
+
|
||||
+ g_slist_free(list);
|
||||
+ NS_ADDREF(*aResult = items);
|
||||
+ return NS_OK;
|
||||
+}
|
||||
+
|
||||
+NS_IMETHODIMP
|
||||
nsGConfService::SetBool(const nsACString &aKey, PRBool aValue)
|
||||
{
|
||||
PRBool res = gconf_client_set_bool(mClient, PromiseFlatCString(aKey).get(),
|
||||
--- toolkit/components/gnome/nsIGConfService.idl
|
||||
+++ toolkit/components/gnome/nsIGConfService.idl
|
||||
@@ -37,6 +37,7 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
+#include "nsIArray.idl"
|
||||
|
||||
[scriptable, uuid(01ac7b2e-c07c-465f-b35c-542eaef420a9)]
|
||||
interface nsIGConfService : nsISupports
|
||||
@@ -46,6 +47,7 @@
|
||||
AUTF8String getString(in AUTF8String key);
|
||||
long getInt(in AUTF8String key);
|
||||
float getFloat(in AUTF8String key);
|
||||
+ nsIArray getStringList(in AUTF8String key);
|
||||
|
||||
void setBool(in AUTF8String key, in boolean value);
|
||||
void setString(in AUTF8String key, in AUTF8String value);
|
||||
--- toolkit/components/unixproxy/nsUnixSystemProxySettings.cpp
|
||||
+++ toolkit/components/unixproxy/nsUnixSystemProxySettings.cpp
|
||||
@@ -0,0 +1,425 @@
|
||||
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
+/* ***** BEGIN LICENSE BLOCK *****
|
||||
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
+ *
|
||||
+ * The contents of this file are subject to the Mozilla Public License Version
|
||||
+ * 1.1 (the "License"); you may not use this file except in compliance with
|
||||
+ * the License. You may obtain a copy of the License at
|
||||
+ * http://www.mozilla.org/MPL/
|
||||
+ *
|
||||
+ * Software distributed under the License is distributed on an "AS IS" basis,
|
||||
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
+ * for the specific language governing rights and limitations under the
|
||||
+ * License.
|
||||
+ *
|
||||
+ * The Original Code is mozilla.org code.
|
||||
+ *
|
||||
+ * The Initial Developer of the Original Code is
|
||||
+ * Netscape Communications Corporation.
|
||||
+ * Portions created by the Initial Developer are Copyright (C) 1998
|
||||
+ * the Initial Developer. All Rights Reserved.
|
||||
+ *
|
||||
+ * Contributor(s):
|
||||
+ * Robert O'Callahan (rocallahan@novell.com)
|
||||
+ *
|
||||
+ * Alternatively, the contents of this file may be used under the terms of
|
||||
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
+ * in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
+ * of those above. If you wish to allow use of your version of this file only
|
||||
+ * under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
+ * use your version of this file under the terms of the MPL, indicate your
|
||||
+ * decision by deleting the provisions above and replace them with the notice
|
||||
+ * and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
+ * the provisions above, a recipient may use your version of this file under
|
||||
+ * the terms of any one of the MPL, the GPL or the LGPL.
|
||||
+ *
|
||||
+ * ***** END LICENSE BLOCK ***** */
|
||||
+
|
||||
+#include "nsISystemProxySettings.h"
|
||||
+#include "nsIGenericFactory.h"
|
||||
+#include "nsIServiceManager.h"
|
||||
+#include "nsIGConfService.h"
|
||||
+#include "nsIURI.h"
|
||||
+#include "nsReadableUtils.h"
|
||||
+#include "nsArray.h"
|
||||
+#include "prnetdb.h"
|
||||
+#include "prenv.h"
|
||||
+#include "nsPrintfCString.h"
|
||||
+#include "nsNetUtil.h"
|
||||
+#include "nsISupportsPrimitives.h"
|
||||
+
|
||||
+class nsUnixSystemProxySettings : public nsISystemProxySettings {
|
||||
+public:
|
||||
+ NS_DECL_ISUPPORTS
|
||||
+ NS_DECL_NSISYSTEMPROXYSETTINGS
|
||||
+
|
||||
+ nsUnixSystemProxySettings() {}
|
||||
+ nsresult Init();
|
||||
+
|
||||
+private:
|
||||
+ ~nsUnixSystemProxySettings() {}
|
||||
+
|
||||
+ nsCOMPtr<nsIGConfService> mGConf;
|
||||
+};
|
||||
+
|
||||
+NS_IMPL_ISUPPORTS1(nsUnixSystemProxySettings, nsISystemProxySettings)
|
||||
+
|
||||
+nsresult
|
||||
+nsUnixSystemProxySettings::Init()
|
||||
+{
|
||||
+ // If this is a GNOME session, load gconf and try to use its preferences.
|
||||
+ // If gconf is not available (which would be stupid) we'll proceed as if this
|
||||
+ // was not a GNOME session, using *_PROXY environment variables.
|
||||
+ const char* sessionType = PR_GetEnv("DESKTOP_SESSION");
|
||||
+ if (sessionType && !strcmp(sessionType, "gnome")) {
|
||||
+ mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
|
||||
+ }
|
||||
+ return NS_OK;
|
||||
+}
|
||||
+
|
||||
+static PRBool
|
||||
+IsProxyMode(nsIGConfService* aGConf, const char* aMode)
|
||||
+{
|
||||
+ nsCAutoString mode;
|
||||
+ return NS_SUCCEEDED(aGConf->GetString(NS_LITERAL_CSTRING("/system/proxy/mode"), mode)) &&
|
||||
+ mode.EqualsASCII(aMode);
|
||||
+}
|
||||
+
|
||||
+nsresult
|
||||
+nsUnixSystemProxySettings::GetPACURI(nsACString& aResult)
|
||||
+{
|
||||
+ if (!mGConf || !IsProxyMode(mGConf, "auto"))
|
||||
+ return NS_ERROR_FAILURE;
|
||||
+ return mGConf->GetString(NS_LITERAL_CSTRING("/system/proxy/autoconfig_url"),
|
||||
+ aResult);
|
||||
+}
|
||||
+
|
||||
+static PRBool
|
||||
+IsInNoProxyList(const nsACString& aHost, PRInt32 aPort, const char* noProxyVal)
|
||||
+{
|
||||
+ NS_ASSERTION(aPort >= 0, "Negative port?");
|
||||
+
|
||||
+ nsCAutoString noProxy(noProxyVal);
|
||||
+ if (noProxy.EqualsLiteral("*"))
|
||||
+ return PR_TRUE;
|
||||
+
|
||||
+ noProxy.StripWhitespace();
|
||||
+
|
||||
+ nsReadingIterator<char> pos;
|
||||
+ nsReadingIterator<char> end;
|
||||
+ noProxy.BeginReading(pos);
|
||||
+ noProxy.EndReading(end);
|
||||
+ while (pos != end) {
|
||||
+ nsReadingIterator<char> last = pos;
|
||||
+ nsReadingIterator<char> nextPos;
|
||||
+ if (FindCharInReadable(',', last, end)) {
|
||||
+ nextPos = last;
|
||||
+ ++nextPos;
|
||||
+ } else {
|
||||
+ last = end;
|
||||
+ nextPos = end;
|
||||
+ }
|
||||
+
|
||||
+ nsReadingIterator<char> colon = pos;
|
||||
+ PRInt32 port = -1;
|
||||
+ if (FindCharInReadable(':', colon, last)) {
|
||||
+ ++colon;
|
||||
+ nsDependentCSubstring portStr(colon, last);
|
||||
+ nsCAutoString portStr2(portStr);
|
||||
+ PRInt32 err;
|
||||
+ port = portStr2.ToInteger(&err);
|
||||
+ if (err != 0) {
|
||||
+ port = -2; // don't match any port, so we ignore this pattern
|
||||
+ }
|
||||
+ --colon;
|
||||
+ } else {
|
||||
+ colon = last;
|
||||
+ }
|
||||
+
|
||||
+ if (port == -1 || port == aPort) {
|
||||
+ nsDependentCSubstring hostStr(pos, colon);
|
||||
+ if (StringEndsWith(aHost, hostStr, nsCaseInsensitiveCStringComparator()))
|
||||
+ return PR_TRUE;
|
||||
+ }
|
||||
+
|
||||
+ pos = nextPos;
|
||||
+ }
|
||||
+
|
||||
+ return PR_FALSE;
|
||||
+}
|
||||
+
|
||||
+static void SetProxyResult(const char* aType, const nsACString& aHost,
|
||||
+ PRInt32 aPort, nsACString& aResult)
|
||||
+{
|
||||
+ aResult.AppendASCII(aType);
|
||||
+ aResult.Append(' ');
|
||||
+ aResult.Append(aHost);
|
||||
+ aResult.Append(':');
|
||||
+ aResult.Append(nsPrintfCString("%d", aPort));
|
||||
+}
|
||||
+
|
||||
+static nsresult
|
||||
+GetProxyForURIFromEnvironment(const nsACString& aScheme,
|
||||
+ const nsACString& aHost,
|
||||
+ PRInt32 aPort,
|
||||
+ nsACString& aResult)
|
||||
+{
|
||||
+ nsCAutoString envVar;
|
||||
+ envVar.Append(aScheme);
|
||||
+ envVar.AppendLiteral("_proxy");
|
||||
+ const char* proxyVal = PR_GetEnv(envVar.get());
|
||||
+ if (!proxyVal) {
|
||||
+ proxyVal = PR_GetEnv("all_proxy");
|
||||
+ if (!proxyVal) {
|
||||
+ // Return failure so that the caller can detect the failure and
|
||||
+ // fall back to other proxy detection (e.g., WPAD)
|
||||
+ return NS_ERROR_FAILURE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ const char* noProxyVal = PR_GetEnv("no_proxy");
|
||||
+ if (noProxyVal && IsInNoProxyList(aHost, aPort, noProxyVal)) {
|
||||
+ aResult.AppendLiteral("DIRECT");
|
||||
+ return NS_OK;
|
||||
+ }
|
||||
+
|
||||
+ // Use our URI parser to crack the proxy URI
|
||||
+ nsCOMPtr<nsIURI> proxyURI;
|
||||
+ nsresult rv = NS_NewURI(getter_AddRefs(proxyURI), proxyVal);
|
||||
+ if (NS_FAILED(rv))
|
||||
+ return rv;
|
||||
+
|
||||
+ // Is there a way to specify "socks://" or something in these environment
|
||||
+ // variables? I can't find any documentation.
|
||||
+ PRBool isHTTP;
|
||||
+ rv = proxyURI->SchemeIs("http", &isHTTP);
|
||||
+ if (NS_FAILED(rv))
|
||||
+ return rv;
|
||||
+ if (!isHTTP)
|
||||
+ return NS_ERROR_FAILURE;
|
||||
+
|
||||
+ nsCAutoString proxyHost;
|
||||
+ rv = proxyURI->GetHost(proxyHost);
|
||||
+ if (NS_FAILED(rv))
|
||||
+ return rv;
|
||||
+ PRInt32 proxyPort;
|
||||
+ rv = proxyURI->GetPort(&proxyPort);
|
||||
+ if (NS_FAILED(rv))
|
||||
+ return rv;
|
||||
+
|
||||
+ SetProxyResult("PROXY", proxyHost, proxyPort, aResult);
|
||||
+ return NS_OK;
|
||||
+}
|
||||
+
|
||||
+static nsresult
|
||||
+SetProxyResultFromGConf(nsIGConfService* aGConf, const char* aKeyBase,
|
||||
+ const char* aType, nsACString& aResult)
|
||||
+{
|
||||
+ nsCAutoString hostKey;
|
||||
+ hostKey.AppendASCII(aKeyBase);
|
||||
+ hostKey.AppendLiteral("host");
|
||||
+ nsCAutoString host;
|
||||
+ nsresult rv = aGConf->GetString(hostKey, host);
|
||||
+ if (NS_FAILED(rv))
|
||||
+ return rv;
|
||||
+ if (host.IsEmpty())
|
||||
+ return NS_ERROR_FAILURE;
|
||||
+
|
||||
+ nsCAutoString portKey;
|
||||
+ portKey.AppendASCII(aKeyBase);
|
||||
+ portKey.AppendLiteral("port");
|
||||
+ PRInt32 port;
|
||||
+ rv = aGConf->GetInt(portKey, &port);
|
||||
+ if (NS_FAILED(rv))
|
||||
+ return rv;
|
||||
+
|
||||
+ SetProxyResult(aType, host, port, aResult);
|
||||
+ return NS_OK;
|
||||
+}
|
||||
+
|
||||
+/* copied from nsProtocolProxyService.cpp --- we should share this! */
|
||||
+static void
|
||||
+proxy_MaskIPv6Addr(PRIPv6Addr &addr, PRUint16 mask_len)
|
||||
+{
|
||||
+ if (mask_len == 128)
|
||||
+ return;
|
||||
+
|
||||
+ if (mask_len > 96) {
|
||||
+ addr.pr_s6_addr32[3] = PR_htonl(
|
||||
+ PR_ntohl(addr.pr_s6_addr32[3]) & (~0L << (128 - mask_len)));
|
||||
+ }
|
||||
+ else if (mask_len > 64) {
|
||||
+ addr.pr_s6_addr32[3] = 0;
|
||||
+ addr.pr_s6_addr32[2] = PR_htonl(
|
||||
+ PR_ntohl(addr.pr_s6_addr32[2]) & (~0L << (96 - mask_len)));
|
||||
+ }
|
||||
+ else if (mask_len > 32) {
|
||||
+ addr.pr_s6_addr32[3] = 0;
|
||||
+ addr.pr_s6_addr32[2] = 0;
|
||||
+ addr.pr_s6_addr32[1] = PR_htonl(
|
||||
+ PR_ntohl(addr.pr_s6_addr32[1]) & (~0L << (64 - mask_len)));
|
||||
+ }
|
||||
+ else {
|
||||
+ addr.pr_s6_addr32[3] = 0;
|
||||
+ addr.pr_s6_addr32[2] = 0;
|
||||
+ addr.pr_s6_addr32[1] = 0;
|
||||
+ addr.pr_s6_addr32[0] = PR_htonl(
|
||||
+ PR_ntohl(addr.pr_s6_addr32[0]) & (~0L << (32 - mask_len)));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static PRBool ConvertToIPV6Addr(const nsACString& aName,
|
||||
+ PRIPv6Addr* aAddr)
|
||||
+{
|
||||
+ PRNetAddr addr;
|
||||
+ if (PR_StringToNetAddr(PromiseFlatCString(aName).get(), &addr) != PR_SUCCESS)
|
||||
+ return PR_FALSE;
|
||||
+
|
||||
+ PRIPv6Addr ipv6;
|
||||
+ // convert parsed address to IPv6
|
||||
+ if (addr.raw.family == PR_AF_INET) {
|
||||
+ // convert to IPv4-mapped address
|
||||
+ PR_ConvertIPv4AddrToIPv6(addr.inet.ip, &ipv6);
|
||||
+ } else if (addr.raw.family == PR_AF_INET6) {
|
||||
+ // copy the address
|
||||
+ memcpy(&ipv6, &addr.ipv6.ip, sizeof(PRIPv6Addr));
|
||||
+ } else {
|
||||
+ return PR_FALSE;
|
||||
+ }
|
||||
+
|
||||
+ return PR_TRUE;
|
||||
+}
|
||||
+
|
||||
+static PRBool GConfIgnoreHost(const nsACString& aIgnore,
|
||||
+ const nsACString& aHost)
|
||||
+{
|
||||
+ if (aIgnore.Equals(aHost, nsCaseInsensitiveCStringComparator()))
|
||||
+ return PR_TRUE;
|
||||
+
|
||||
+ if (StringBeginsWith(aIgnore, NS_LITERAL_CSTRING("*")) &&
|
||||
+ StringEndsWith(aHost, nsDependentCSubstring(aIgnore, 1),
|
||||
+ nsCaseInsensitiveCStringComparator()))
|
||||
+ return PR_TRUE;
|
||||
+
|
||||
+ PRInt32 mask = 128;
|
||||
+ nsReadingIterator<char> start;
|
||||
+ nsReadingIterator<char> slash;
|
||||
+ nsReadingIterator<char> end;
|
||||
+ aIgnore.BeginReading(start);
|
||||
+ aIgnore.BeginReading(slash);
|
||||
+ aIgnore.EndReading(end);
|
||||
+ if (FindCharInReadable('/', slash, end)) {
|
||||
+ ++slash;
|
||||
+ nsDependentCSubstring maskStr(slash, end);
|
||||
+ nsCAutoString maskStr2(maskStr);
|
||||
+ PRInt32 err;
|
||||
+ mask = maskStr2.ToInteger(&err);
|
||||
+ if (err != 0) {
|
||||
+ mask = 128;
|
||||
+ }
|
||||
+ --slash;
|
||||
+ } else {
|
||||
+ slash = end;
|
||||
+ }
|
||||
+
|
||||
+ PRIPv6Addr ignoreAddr, hostAddr;
|
||||
+ if (!ConvertToIPV6Addr(aIgnore, &ignoreAddr) ||
|
||||
+ !ConvertToIPV6Addr(aHost, &hostAddr))
|
||||
+ return PR_FALSE;
|
||||
+
|
||||
+ proxy_MaskIPv6Addr(ignoreAddr, mask);
|
||||
+ proxy_MaskIPv6Addr(hostAddr, mask);
|
||||
+
|
||||
+ return memcmp(&ignoreAddr, &hostAddr, sizeof(PRIPv6Addr)) == 0;
|
||||
+}
|
||||
+
|
||||
+static nsresult
|
||||
+GetProxyForURIFromGConf(nsIGConfService* aGConf,
|
||||
+ const nsACString& aScheme,
|
||||
+ const nsACString& aHost,
|
||||
+ PRInt32 aPort,
|
||||
+ nsACString& aResult)
|
||||
+{
|
||||
+ if (!IsProxyMode(aGConf, "manual")) {
|
||||
+ aResult.AppendLiteral("DIRECT");
|
||||
+ return NS_OK;
|
||||
+ }
|
||||
+
|
||||
+ nsCOMPtr<nsIArray> ignoreList;
|
||||
+ if (NS_SUCCEEDED(aGConf->GetStringList(NS_LITERAL_CSTRING("/system/http_proxy/ignore_hosts"),
|
||||
+ getter_AddRefs(ignoreList))) && ignoreList) {
|
||||
+ PRUint32 len = 0;
|
||||
+ ignoreList->GetLength(&len);
|
||||
+ for (PRUint32 i = 0; i < len; ++i) {
|
||||
+ nsCOMPtr<nsISupportsCString> str = do_QueryElementAt(ignoreList, i);
|
||||
+ if (str) {
|
||||
+ nsCAutoString s;
|
||||
+ if (NS_SUCCEEDED(str->GetData(s)) && !s.IsEmpty()) {
|
||||
+ if (GConfIgnoreHost(s, aHost)) {
|
||||
+ aResult.AppendLiteral("DIRECT");
|
||||
+ return NS_OK;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ nsresult rv = SetProxyResultFromGConf(aGConf, "/system/proxy/socks_", "SOCKS", aResult);
|
||||
+ if (NS_SUCCEEDED(rv))
|
||||
+ return rv;
|
||||
+
|
||||
+ if (aScheme.LowerCaseEqualsLiteral("http")) {
|
||||
+ rv = SetProxyResultFromGConf(aGConf, "/system/http_proxy/", "PROXY", aResult);
|
||||
+ } else if (aScheme.LowerCaseEqualsLiteral("https")) {
|
||||
+ rv = SetProxyResultFromGConf(aGConf, "/system/proxy/secure_", "PROXY", aResult);
|
||||
+ } else if (aScheme.LowerCaseEqualsLiteral("ftp")) {
|
||||
+ rv = SetProxyResultFromGConf(aGConf, "/system/proxy/ftp_", "PROXY", aResult);
|
||||
+ } else {
|
||||
+ rv = NS_ERROR_FAILURE;
|
||||
+ }
|
||||
+
|
||||
+ if (NS_FAILED(rv)) {
|
||||
+ aResult.AppendLiteral("DIRECT");
|
||||
+ }
|
||||
+ return NS_OK;
|
||||
+}
|
||||
+
|
||||
+nsresult
|
||||
+nsUnixSystemProxySettings::GetProxyForURI(nsIURI* aURI, nsACString& aResult)
|
||||
+{
|
||||
+ nsCAutoString scheme;
|
||||
+ nsresult rv = aURI->GetScheme(scheme);
|
||||
+ if (NS_FAILED(rv))
|
||||
+ return rv;
|
||||
+
|
||||
+ nsCAutoString host;
|
||||
+ rv = aURI->GetHost(host);
|
||||
+ if (NS_FAILED(rv))
|
||||
+ return rv;
|
||||
+
|
||||
+ PRInt32 port;
|
||||
+ rv = aURI->GetPort(&port);
|
||||
+ if (NS_FAILED(rv))
|
||||
+ return rv;
|
||||
+
|
||||
+ if (!mGConf)
|
||||
+ return GetProxyForURIFromEnvironment(scheme, host, port, aResult);
|
||||
+
|
||||
+ return GetProxyForURIFromGConf(mGConf, scheme, host, port, aResult);
|
||||
+}
|
||||
+
|
||||
+#define NS_UNIXSYSTEMPROXYSERVICE_CID /* 0fa3158c-d5a7-43de-9181-a285e74cf1d4 */\
|
||||
+ { 0x0fa3158c, 0xd5a7, 0x43de, \
|
||||
+ {0x91, 0x81, 0xa2, 0x85, 0xe7, 0x4c, 0xf1, 0xd4 } }
|
||||
+
|
||||
+NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUnixSystemProxySettings, Init)
|
||||
+
|
||||
+static const nsModuleComponentInfo components[] = {
|
||||
+ { "Unix System Proxy Settings Service",
|
||||
+ NS_UNIXSYSTEMPROXYSERVICE_CID,
|
||||
+ NS_SYSTEMPROXYSETTINGS_CONTRACTID,
|
||||
+ nsUnixSystemProxySettingsConstructor }
|
||||
+};
|
||||
+
|
||||
+NS_IMPL_NSGETMODULE(unixproxy, components)
|
||||
Index: Makefile.in
|
||||
===================================================================
|
||||
RCS file: /cvsroot/mozilla/Makefile.in,v
|
||||
retrieving revision 1.299.2.18
|
||||
diff -u -p -6 -r1.299.2.18 Makefile.in
|
||||
--- Makefile.in 14 Sep 2006 18:07:02 -0000 1.299.2.18
|
||||
+++ Makefile.in 27 Nov 2006 19:04:14 -0000
|
||||
@@ -282,12 +282,13 @@ tier_50_dirs += directory/xpcom
|
||||
endif
|
||||
|
||||
ifndef MINIMO
|
||||
ifdef MOZ_XUL_APP
|
||||
ifdef MOZ_ENABLE_GTK2
|
||||
tier_50_dirs += toolkit/components/gnome
|
||||
+tier_50_dirs += toolkit/components/unixproxy
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef MOZ_LEAKY
|
||||
tier_50_dirs += tools/leaky
|
||||
--- toolkit/components/unixproxy/Makefile.in.orig 2006-11-27 21:25:50.000000000 +0100
|
||||
+++ toolkit/components/unixproxy/Makefile.in 2006-11-27 21:26:18.000000000 +0100
|
||||
@@ -0,0 +1,67 @@
|
||||
+# ***** BEGIN LICENSE BLOCK *****
|
||||
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
+#
|
||||
+# The contents of this file are subject to the Mozilla Public License Version
|
||||
+# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
+# the License. You may obtain a copy of the License at
|
||||
+# http://www.mozilla.org/MPL/
|
||||
+#
|
||||
+# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
+# for the specific language governing rights and limitations under the
|
||||
+# License.
|
||||
+#
|
||||
+# The Original Code is the Mozilla GNOME integration code.
|
||||
+#
|
||||
+# The Initial Developer of the Original Code is
|
||||
+# IBM Corporation.
|
||||
+# Portions created by the Initial Developer are Copyright (C) 2004
|
||||
+# the Initial Developer. All Rights Reserved.
|
||||
+#
|
||||
+# Contributor(s):
|
||||
+# Brian Ryner <bryner@brianryner.com>
|
||||
+#
|
||||
+# Alternatively, the contents of this file may be used under the terms of
|
||||
+# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
+# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
+# of those above. If you wish to allow use of your version of this file only
|
||||
+# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
+# use your version of this file under the terms of the MPL, indicate your
|
||||
+# decision by deleting the provisions above and replace them with the notice
|
||||
+# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
+# the provisions above, a recipient may use your version of this file under
|
||||
+# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
+#
|
||||
+# ***** END LICENSE BLOCK *****
|
||||
+
|
||||
+DEPTH = ../../..
|
||||
+topsrcdir = @top_srcdir@
|
||||
+srcdir = @srcdir@
|
||||
+VPATH = @srcdir@
|
||||
+
|
||||
+include $(DEPTH)/config/autoconf.mk
|
||||
+
|
||||
+MODULE = unixproxy
|
||||
+MOZILLA_INTERNAL_API = 1
|
||||
+
|
||||
+REQUIRES = \
|
||||
+ xpcom \
|
||||
+ string \
|
||||
+ necko \
|
||||
+ mozgnome \
|
||||
+ $(NULL)
|
||||
+
|
||||
+CPPSRCS = \
|
||||
+ nsUnixSystemProxySettings.cpp \
|
||||
+ $(NULL)
|
||||
+
|
||||
+LIBRARY_NAME = unixproxy
|
||||
+IS_COMPONENT = 1
|
||||
+FORCE_SHARED_LIB = 1
|
||||
+
|
||||
+EXTRA_DSO_LDOPTS += \
|
||||
+ $(MOZ_COMPONENT_LIBS) \
|
||||
+ $(NULL)
|
||||
+
|
||||
+include $(topsrcdir)/config/rules.mk
|
@ -1,11 +0,0 @@
|
||||
--- tango@novell.com/install.rdf 2006-11-27 19:40:24.000000000 +0100
|
||||
+++ tango@novell.com/install.rdf.new 2006-12-19 23:22:41.846376000 +0100
|
||||
@@ -14,7 +14,7 @@
|
||||
<Description>
|
||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
||||
<em:minVersion>1.9</em:minVersion>
|
||||
- <em:maxVersion>2.0</em:maxVersion>
|
||||
+ <em:maxVersion>2.0.0.*</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:36f5e5df7f49358c4fe9c5f69ff77d1a1efdf06d3f364e8e39c00ce771b3a2a9
|
||||
size 674974
|
@ -1,22 +0,0 @@
|
||||
From: Wolfgang Rosenauer <stark@suse.de>
|
||||
Subject: disable visibility feature
|
||||
References:
|
||||
https://bugzilla.novell.com/show_bug.cgi?id=83908
|
||||
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20297
|
||||
|
||||
because of a gcc bug it's not possible to build with that
|
||||
feature at the moment
|
||||
|
||||
Index: configure
|
||||
===================================================================
|
||||
--- configure.orig
|
||||
+++ configure
|
||||
@@ -7949,7 +7949,7 @@ EOF
|
||||
if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
|
||||
if egrep '\.(hidden|extern_private).*foo_hidden' conftest.s >/dev/null; then
|
||||
if ! egrep '\.(hidden|extern_private).*foo_default' conftest.s > /dev/null; then
|
||||
- ac_cv_visibility_pragma=yes
|
||||
+ ac_cv_visibility_pragma=no
|
||||
fi
|
||||
fi
|
||||
fi
|
@ -1,236 +0,0 @@
|
||||
From: upstream
|
||||
Subject: Support X11 session management
|
||||
References:
|
||||
https://bugzilla.novell.com/show_bug.cgi?id=227047
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=93789
|
||||
|
||||
diff --git a/toolkit/xre/Makefile.in b/toolkit/xre/Makefile.in
|
||||
index e3dd8d9..4371882 100644
|
||||
--- a/toolkit/xre/Makefile.in
|
||||
+++ b/toolkit/xre/Makefile.in
|
||||
@@ -137,21 +137,25 @@ ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_
|
||||
CPPSRCS += nsNativeAppSupportMac.cpp
|
||||
else
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
|
||||
CPPSRCS += nsNativeAppSupportOS2.cpp
|
||||
else
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),beos)
|
||||
CPPSRCS += nsNativeAppSupportBeOS.cpp
|
||||
else
|
||||
+ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
|
||||
+CPPSRCS += nsNativeAppSupportUnix.cpp
|
||||
+else
|
||||
CPPSRCS += nsNativeAppSupportDefault.cpp
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
+endif
|
||||
|
||||
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
||||
CMSRCS = MacLaunchHelper.m
|
||||
CPPSRCS += nsCommandLineServiceMac.cpp
|
||||
LOCAL_INCLUDES += -I$(topsrcdir)/xpfe/bootstrap/appleevents
|
||||
OS_CXXFLAGS += -fexceptions
|
||||
SHARED_LIBRARY_LIBS += $(DEPTH)/xpfe/bootstrap/appleevents/$(LIB_PREFIX)appleevents_s.$(LIB_SUFFIX)
|
||||
endif
|
||||
diff --git a/toolkit/xre/nsNativeAppSupportUnix.cpp b/toolkit/xre/nsNativeAppSupportUnix.cpp
|
||||
new file mode 100644
|
||||
index 0000000..ad73f4c
|
||||
--- /dev/null
|
||||
+++ b/toolkit/xre/nsNativeAppSupportUnix.cpp
|
||||
@@ -0,0 +1,194 @@
|
||||
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
+/* ***** BEGIN LICENSE BLOCK *****
|
||||
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
+ *
|
||||
+ * The contents of this file are subject to the Mozilla Public License Version
|
||||
+ * 1.1 (the "License"); you may not use this file except in compliance with
|
||||
+ * the License. You may obtain a copy of the License at
|
||||
+ * http://www.mozilla.org/MPL/
|
||||
+ *
|
||||
+ * Software distributed under the License is distributed on an "AS IS" basis,
|
||||
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
+ * for the specific language governing rights and limitations under the
|
||||
+ * License.
|
||||
+ *
|
||||
+ * The Original Code is Unix Native App Support.
|
||||
+ *
|
||||
+ * The Initial Developer of the Original Code is
|
||||
+ * Mozilla Corporation.
|
||||
+ * Portions created by the Initial Developer are Copyright (C) 2007
|
||||
+ * the Initial Developer. All Rights Reserved.
|
||||
+ *
|
||||
+ * Contributor(s):
|
||||
+ * Michael Wu <flamingice@sourmilk.net> (original author)
|
||||
+ *
|
||||
+ * Alternatively, the contents of this file may be used under the terms of
|
||||
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
+ * in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
+ * of those above. If you wish to allow use of your version of this file only
|
||||
+ * under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
+ * use your version of this file under the terms of the MPL, indicate your
|
||||
+ * decision by deleting the provisions above and replace them with the notice
|
||||
+ * and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
+ * the provisions above, a recipient may use your version of this file under
|
||||
+ * the terms of any one of the MPL, the GPL or the LGPL.
|
||||
+ *
|
||||
+ * ***** END LICENSE BLOCK ***** */
|
||||
+
|
||||
+#include "nsNativeAppSupportBase.h"
|
||||
+#include "nsCOMPtr.h"
|
||||
+#include "nsXPCOM.h"
|
||||
+#include "nsISupportsPrimitives.h"
|
||||
+#include "nsIObserverService.h"
|
||||
+#include "nsIAppStartup.h"
|
||||
+#include "nsServiceManagerUtils.h"
|
||||
+#include "prlink.h"
|
||||
+
|
||||
+#include <glib.h>
|
||||
+#include <glib-object.h>
|
||||
+
|
||||
+typedef struct _GnomeProgram GnomeProgram;
|
||||
+typedef struct _GnomeModuleInfo GnomeModuleInfo;
|
||||
+typedef struct _GnomeClient GnomeClient;
|
||||
+
|
||||
+typedef enum {
|
||||
+ GNOME_SAVE_GLOBAL,
|
||||
+ GNOME_SAVE_LOCAL,
|
||||
+ GNOME_SAVE_BOTH
|
||||
+} GnomeSaveStyle;
|
||||
+
|
||||
+typedef enum {
|
||||
+ GNOME_INTERACT_NONE,
|
||||
+ GNOME_INTERACT_ERRORS,
|
||||
+ GNOME_INTERACT_ANY
|
||||
+} GnomeInteractStyle;
|
||||
+
|
||||
+typedef enum {
|
||||
+ GNOME_DIALOG_ERROR,
|
||||
+ GNOME_DIALOG_NORMAL
|
||||
+} GnomeDialogType;
|
||||
+
|
||||
+typedef GnomeProgram * (*_gnome_program_init_fn)(const char *, const char *,
|
||||
+ const GnomeModuleInfo *, int,
|
||||
+ char **, const char *, ...);
|
||||
+typedef const GnomeModuleInfo * (*_libgnomeui_module_info_get_fn)();
|
||||
+typedef GnomeClient * (*_gnome_master_client_fn)(void);
|
||||
+typedef void (*GnomeInteractFunction)(GnomeClient *, gint, GnomeDialogType,
|
||||
+ gpointer);
|
||||
+typedef void (*_gnome_client_request_interaction_fn)(GnomeClient *,
|
||||
+ GnomeDialogType,
|
||||
+ GnomeInteractFunction,
|
||||
+ gpointer);
|
||||
+typedef void (*_gnome_interaction_key_return_fn)(gint, gboolean);
|
||||
+
|
||||
+static _gnome_client_request_interaction_fn gnome_client_request_interaction;
|
||||
+static _gnome_interaction_key_return_fn gnome_interaction_key_return;
|
||||
+
|
||||
+void interact_cb(GnomeClient *client, gint key,
|
||||
+ GnomeDialogType type, gpointer data)
|
||||
+{
|
||||
+ nsCOMPtr<nsIObserverService> obsServ =
|
||||
+ do_GetService("@mozilla.org/observer-service;1");
|
||||
+ nsCOMPtr<nsISupportsPRBool> cancelQuit =
|
||||
+ do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID);
|
||||
+
|
||||
+ cancelQuit->SetData(PR_FALSE);
|
||||
+
|
||||
+ obsServ->NotifyObservers(cancelQuit, "quit-application-requested", nsnull);
|
||||
+
|
||||
+ PRBool abortQuit;
|
||||
+ cancelQuit->GetData(&abortQuit);
|
||||
+
|
||||
+ gnome_interaction_key_return(key, abortQuit);
|
||||
+}
|
||||
+
|
||||
+gboolean save_yourself_cb(GnomeClient *client, gint phase,
|
||||
+ GnomeSaveStyle style, gboolean shutdown,
|
||||
+ GnomeInteractStyle interact, gboolean fast,
|
||||
+ gpointer user_data)
|
||||
+{
|
||||
+ if (interact == GNOME_INTERACT_ANY)
|
||||
+ gnome_client_request_interaction(client, GNOME_DIALOG_NORMAL,
|
||||
+ interact_cb, nsnull);
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+void die_cb(GnomeClient *client, gpointer user_data)
|
||||
+{
|
||||
+ nsCOMPtr<nsIObserverService> obsServ =
|
||||
+ do_GetService("@mozilla.org/observer-service;1");
|
||||
+ nsCOMPtr<nsIAppStartup> appService =
|
||||
+ do_GetService("@mozilla.org/toolkit/app-startup;1");
|
||||
+
|
||||
+ if (obsServ)
|
||||
+ obsServ->NotifyObservers(nsnull, "quit-application-granted", nsnull);
|
||||
+
|
||||
+ if (appService)
|
||||
+ appService->Quit(nsIAppStartup::eForceQuit);
|
||||
+}
|
||||
+
|
||||
+class nsNativeAppSupportUnix : public nsNativeAppSupportBase
|
||||
+{
|
||||
+public:
|
||||
+ NS_IMETHOD Start(PRBool* aRetVal);
|
||||
+};
|
||||
+
|
||||
+NS_IMETHODIMP
|
||||
+nsNativeAppSupportUnix::Start(PRBool *aRetVal)
|
||||
+{
|
||||
+ *aRetVal = PR_TRUE;
|
||||
+
|
||||
+ PRLibrary *gnomeuiLib = PR_LoadLibrary("libgnomeui-2.so.0");
|
||||
+ if (!gnomeuiLib)
|
||||
+ return NS_OK;
|
||||
+
|
||||
+ PRLibrary *gnomeLib = PR_LoadLibrary("libgnome-2.so.0");
|
||||
+ if (!gnomeLib) {
|
||||
+ PR_UnloadLibrary(gnomeuiLib);
|
||||
+ return NS_OK;
|
||||
+ }
|
||||
+
|
||||
+ _gnome_program_init_fn gnome_program_init =
|
||||
+ (_gnome_program_init_fn)PR_FindFunctionSymbol(gnomeLib, "gnome_program_init");
|
||||
+ _libgnomeui_module_info_get_fn libgnomeui_module_info_get = (_libgnomeui_module_info_get_fn)PR_FindFunctionSymbol(gnomeuiLib, "libgnomeui_module_info_get");
|
||||
+ if (!gnome_program_init || !libgnomeui_module_info_get) {
|
||||
+ PR_UnloadLibrary(gnomeuiLib);
|
||||
+ PR_UnloadLibrary(gnomeLib);
|
||||
+ return NS_OK;
|
||||
+ }
|
||||
+
|
||||
+ char *argv[2] = { "gecko", "--disable-crash-dialog" };
|
||||
+ gnome_program_init("Gecko", "1.0", libgnomeui_module_info_get(), 2, argv, NULL);
|
||||
+
|
||||
+ // Careful! These libraries cannot be unloaded after this point because
|
||||
+ // gnome_program_init causes atexit handlers to be registered. Strange
|
||||
+ // crashes will occur if these libraries are unloaded.
|
||||
+
|
||||
+ gnome_client_request_interaction = (_gnome_client_request_interaction_fn)
|
||||
+ PR_FindFunctionSymbol(gnomeuiLib, "gnome_client_request_interaction");
|
||||
+ gnome_interaction_key_return = (_gnome_interaction_key_return_fn)
|
||||
+ PR_FindFunctionSymbol(gnomeuiLib, "gnome_interaction_key_return");
|
||||
+
|
||||
+ _gnome_master_client_fn gnome_master_client = (_gnome_master_client_fn)
|
||||
+ PR_FindFunctionSymbol(gnomeuiLib, "gnome_master_client");
|
||||
+
|
||||
+ GnomeClient *client = gnome_master_client();
|
||||
+ g_signal_connect(client, "save-yourself", G_CALLBACK(save_yourself_cb), NULL);
|
||||
+ g_signal_connect(client, "die", G_CALLBACK(die_cb), NULL);
|
||||
+
|
||||
+ return NS_OK;
|
||||
+}
|
||||
+
|
||||
+nsresult
|
||||
+NS_CreateNativeAppSupport(nsINativeAppSupport **aResult)
|
||||
+{
|
||||
+ nsNativeAppSupportBase* native = new nsNativeAppSupportUnix();
|
||||
+ if (!native)
|
||||
+ return NS_ERROR_OUT_OF_MEMORY;
|
||||
+
|
||||
+ *aResult = native;
|
||||
+ NS_ADDREF(*aResult);
|
||||
+
|
||||
+ return NS_OK;
|
||||
+}
|
Loading…
x
Reference in New Issue
Block a user