--- browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf.in
+++ browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf.in
@@ -29,6 +29,15 @@
Mozilla Contributorsclassic/1.0
+
+
+
+ skin/classic/browser/
+ skin/classic/global/
+ skin/classic/communicator/
+ skin/classic/mozapps/
+
+
--- browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf
+++ browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf
@@ -0,0 +1,43 @@
+
+
+
+
+
+ {972ce4c6-7e08-4474-a285-3208198ce6fd}
+ 2.0
+
+
+
+
+ {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+ 1.0
+ 1.0
+
+
+
+
+ Firefox (default)
+ The default theme
+
+ true
+
+
+
+ Gerich and Horlander
+ Mozilla Contributors
+
+ classic/1.0
+
+
+
+ skin/classic/browser/
+ skin/classic/global/
+ skin/classic/communicator/
+ skin/classic/mozapps/
+
+
+
+
+
--- browser/app/profile/firefox.js
+++ browser/app/profile/firefox.js
@@ -38,6 +38,9 @@
// SYNTAX HINTS: dashes are delimiters. Use underscores instead.
// The first character after a period must be alphabetic.
+// Disable default browser checking.
+pref("browser.shell.checkDefaultBrowser", false);
+
// pref("startup.homepage_override_url","chrome://browser-region/locale/region.properties");
pref("general.startup.browser", true);
@@ -62,8 +65,8 @@
);
// App-specific update preferences
-pref("app.update.enabled", true); // Whether or not app updates are enabled
-pref("app.update.autoUpdateEnabled", true); // Whether or not background app updates
+pref("app.update.enabled", false); // Whether or not app updates are enabled
+pref("app.update.autoUpdateEnabled", false); // Whether or not background app updates
// are enabled
pref("app.update.url", "chrome://mozapps/locale/update/update.properties");
pref("app.update.updatesAvailable", false);
@@ -81,7 +84,7 @@
// .. etc ..
//
pref("extensions.update.enabled", true);
-pref("extensions.update.autoUpdateEnabled", true);
+pref("extensions.update.autoUpdateEnabled", false);
pref("extensions.update.url", "chrome://mozapps/locale/extensions/extensions.properties");
pref("extensions.update.autoUpdate", false); // Automatically download and install
// updates to themes and extensions.
@@ -123,9 +126,9 @@
pref("general.skins.selectedSkin", "classic/1.0");
pref("general.useragent.vendor", "Firefox");
-pref("general.useragent.vendorSub",
-#expand __APP_VERSION__
-);
+pref("general.useragent.vendorSub", "1.0");
+//#expand __APP_VERSION__
+//);
pref("general.smoothScroll", false);
#ifdef XP_UNIX
@@ -141,10 +144,10 @@
// 0 = blank, 1 = home (browser.startup.homepage), 2 = last
// XXXBlake Remove this stupid pref
pref("browser.startup.page", 1);
-pref("browser.startup.homepage", "resource:/browserconfig.properties");
+pref("browser.startup.homepage", "chrome://browser-region/locale/region.properties");
// These values are deliberately non-localizable for official builds.
-pref("browser.startup.homepage_reset", "resource:/browserconfig.properties");
+pref("browser.startup.homepage_reset", "chrome://browser-region/locale/region.properties");
pref("browser.update.resetHomepage", false);
// "browser.startup.homepage_override" was for 4.x
pref("browser.startup.homepage_override.1", false);
@@ -236,6 +239,9 @@
pref("network.cookie.cookieBehavior", 0); // cookies enabled
pref("network.cookie.enableForCurrentSessionOnly", false);
+// Use LANG environment variable to choose locale
+pref("intl.locale.matchOS", true);
+
// l12n and i18n
pref("intl.accept_languages", "chrome://global/locale/intl.properties");
// collationOption is only set on linux for japanese. see bug 18338 and 62015
@@ -258,6 +264,8 @@
pref("mousewheel.withshiftkey.action",2);
pref("mousewheel.withaltkey.action",0);
+pref("middlemouse.contentLoadURL", false); // setting to false disables pasting urls on to the page
+
pref("profile.allow_automigration", false); // setting to false bypasses automigration in the profile code
// Customizable toolbar stuff
@@ -326,3 +334,12 @@
// plugin finder service
pref("pfs.datasource.url", "chrome://mozapps/locale/plugins/plugins.properties");
+
+// enable negotiate extension
+pref("network.negotiate-auth.trusted-uris", "https://");
+
+// don't raise windows by default
+pref("mozilla.widget.raise-on-setfocus", false);
+
+// disable IDN for now, since it's a phising risk
+//pref("network.enableIDN", false);
--- browser/app/Makefile.in
+++ browser/app/Makefile.in
@@ -320,4 +320,4 @@
$(INSTALL) $^ $(DIST)/bin/defaults/profile
install:: $(srcdir)/profile/prefs.js
- $(SYSINSTALL) $(IFLAGS1) $^ $(destdir)$(bindir)/defaults/profile
+ $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(bindir)/defaults/profile
--- browser/base/content/aboutDialog.css
+++ browser/base/content/aboutDialog.css
@@ -26,11 +26,7 @@
-moz-appearance: none;
overflow: hidden;
-#ifdef XP_MACOSX
height: 3.8em;
-#else
- height: 2.4em;
-#endif
border: none;
}
--- browser/base/content/browserconfig.properties
+++ browser/base/content/browserconfig.properties
@@ -1,3 +1,3 @@
# Do NOT localize or otherwise change these values
browser.startup.homepage=http://www.mozilla.org/products/firefox/central.html
-browser.startup.homepage_reset=http://www.mozilla.org/products/firefox/central.html
\ No newline at end of file
+browser.startup.homepage_reset=http://www.mozilla.org/products/firefox/central.html
--- browser/base/content/openLocation.xul
+++ browser/base/content/openLocation.xul
@@ -32,6 +32,7 @@
title="&caption.label;"
onload="onLoad()"
buttonlabelaccept="&openBtn.label;"
+ buttoniconaccept="open"
ondialogaccept="open()"
style="width: 40em;"
persist="screenX screenY"
--- browser/base/content/pageInfo.xul
+++ browser/base/content/pageInfo.xul
@@ -297,7 +297,8 @@
-
+
--- browser/base/content/pageReport.xul
+++ browser/base/content/pageReport.xul
@@ -49,9 +49,9 @@
+ disabled="true" accesskey="&unblock.accesskey;" icon="yes"/>
-
--- browser/base/content/searchconfig.properties
+++ browser/base/content/searchconfig.properties
@@ -3,4 +3,4 @@
browser.search.param.Google.1.default=client=firefox
browser.search.param.Google.release=rls=%S:%S:unofficial
-browser.search.param.Yahoo.release=rls=%S:%S:unofficial
\ No newline at end of file
+browser.search.param.Yahoo.release=rls=%S:%S:unofficial
--- browser/components/bookmarks/content/addBookmark.xul
+++ browser/components/bookmarks/content/addBookmark.xul
@@ -93,7 +93,7 @@
+ oncommand="createNewFolder();" icon="open"/>
--- browser/components/bookmarks/content/addBookmark2.xul
+++ browser/components/bookmarks/content/addBookmark2.xul
@@ -42,6 +42,8 @@
buttonlabelextra2="&newFolder.label;" buttonaccesskeyextra2="&newFolder.accesskey;"
#ifdef XP_UNIX
buttonlabelaccept="&acceptButton.label;"
+ buttoniconaccept="add"
+ buttoniconextra2="open"
#endif
title="&newBookmark.title;" title-selectFolder="&selectFolder.label;"
onload="Startup();"
--- browser/components/cookieviewer/content/CookieExceptions.xul
+++ browser/components/cookieviewer/content/CookieExceptions.xul
@@ -47,12 +47,12 @@
-
-
@@ -71,9 +71,9 @@
-
-
--- browser/components/cookieviewer/content/CookieViewer.xul
+++ browser/components/cookieviewer/content/CookieViewer.xul
@@ -112,10 +112,10 @@
-
-
--- browser/components/prefwindow/content/pref-advanced.xul
+++ browser/components/prefwindow/content/pref-advanced.xul
@@ -72,9 +72,9 @@
open="true" persist="open" clearhidden="true" align="left">
-
+ prefstring="app.update.autoUpdateEnabled"/ -->
@@ -112,7 +112,7 @@
@@ -125,7 +125,7 @@
@@ -139,7 +139,7 @@
--- browser/components/prefwindow/content/pref-features-images.xul
+++ browser/components/prefwindow/content/pref-features-images.xul
@@ -54,11 +54,11 @@
-
--- browser/components/prefwindow/content/pref-navigator.xul
+++ browser/components/prefwindow/content/pref-navigator.xul
@@ -86,7 +86,7 @@
&fontsInfo.label;
-
@@ -118,7 +118,7 @@
&proxiesInfo.label;
--- browser/components/shell/src/nsGNOMEShellService.h
+++ browser/components/shell/src/nsGNOMEShellService.h
@@ -43,7 +43,7 @@
class nsGNOMEShellService : public nsIShellService
{
public:
- nsGNOMEShellService() : mCheckedThisSession(PR_FALSE) { }
+ nsGNOMEShellService() : mCheckedThisSession(PR_TRUE) { }
NS_DECL_ISUPPORTS
NS_DECL_NSISHELLSERVICE
--- browser/locales/en-US/chrome/browser-region/region.properties
+++ browser/locales/en-US/chrome/browser-region/region.properties
@@ -1,21 +1,21 @@
general.useragent.contentlocale=US
-homePageDefault=http://www.mozilla.org/products/firefox/start/
+homePageDefault=file:///usr/share/ubuntu-artwork/home/index.html
fallbackDefaultSearchURL=http://www.google.com/search?&q=
tellAFriendURL=http://www.spreadfirefox.com/
promoteURL=http://www.spreadfirefox.com/promote/
# firefox.js
-browser.startup.homepage=http://start.mozilla.org/firefox/
-browser.throbber.url=http://www.mozilla.org/products/firefox/central.html
+browser.startup.homepage=file:///usr/share/ubuntu-artwork/home/index.html
+browser.throbber.url=file:///usr/share/ubuntu-artwork/home/index.html
browser.search.defaulturl=http://www.google.com/search?lr=&ie=UTF-8&oe=UTF-8&q=
browser.search.order.1=Google
browser.search.order.2=Yahoo
#config.js
-startup.homepage_override_url=http://www.mozilla.org/products/firefox/start/
+startup.homepage_override_url=file:///usr/share/ubuntu-artwork/home/index.html
# search-panel.properties
defaultSearchURL=http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=
--- browser/locales/en-US/searchplugins/list.txt
+++ browser/locales/en-US/searchplugins/list.txt
@@ -3,4 +3,4 @@
dictionary
eBay
yahoo
-creativecommons
\ No newline at end of file
+creativecommons
--- browser/themes/Makefile.in
+++ browser/themes/Makefile.in
@@ -45,8 +45,9 @@
#
# Theme Selection
#
-# Windows, GNOME/Linux Winstripe
+# Windows Winstripe
# MacOS X Pinstripe
+# GNOME/Linux Gnomestripe
#
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
--- build/unix/run-mozilla.sh
+++ build/unix/run-mozilla.sh
@@ -249,16 +249,18 @@
fi
if [ -x "$debugger" ]
then
- echo "set args ${1+"$@"}" > /tmp/mozargs$$
+ tmpfile=`mktemp -t` || { echo "Cannot create temporary file" >&2; exit 1; }
+ trap " [ -f \"$tmpfile\" ] && /bin/rm -f -- \"$tmpfile\"" 0 1 2 3 13 15
+ echo "set args ${1+"$@"}" > $tmpfile
# If you are not using ddd, gdb and know of a way to convey the arguments
# over to the prog then add that here- Gagan Saksena 03/15/00
case `basename $debugger` in
- gdb) echo "$debugger $prog -x /tmp/mozargs$$"
- $debugger "$prog" -x /tmp/mozargs$$
+ gdb) echo "$debugger $prog -x $tmpfile"
+ $debugger "$prog" -x $tmpfile
exitcode=$?
;;
- ddd) echo "$debugger --debugger \"gdb -x /tmp/mozargs$$\" $prog"
- $debugger --debugger "gdb -x /tmp/mozargs$$" "$prog"
+ ddd) echo "$debugger --debugger \"gdb -x $tmpfile\" $prog"
+ $debugger --debugger "gdb -x $tmpfile" "$prog"
exitcode=$?
;;
*) echo "$debugger $prog ${1+"$@"}"
@@ -266,7 +268,6 @@
exitcode=$?
;;
esac
- /bin/rm /tmp/mozargs$$
else
echo "Could not find a debugger on your system."
fi
--- build/unix/firefox-config
+++ build/unix/firefox-config
@@ -0,0 +1,142 @@
+#!/bin/sh
+
+prefix=/usr
+exec_prefix=/usr
+exec_prefix_set=no
+
+usage()
+{
+ cat <&2
+fi
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case $1 in
+ --prefix=*)
+ prefix=$optarg
+ if test $exec_prefix_set = no ; then
+ exec_prefix=$optarg
+ fi
+ ;;
+ --prefix)
+ echo_prefix=yes
+ ;;
+ --exec-prefix=*)
+ exec_prefix=$optarg
+ exec_prefix_set=yes
+ ;;
+ --exec-prefix)
+ echo_exec_prefix=yes
+ ;;
+ --version)
+ echo 1.0.2
+ exit 0
+ ;;
+ --cflags)
+ if test "/usr/include/mozilla-firefox" != /usr/include ; then
+ includes="-I/usr/include/mozilla-firefox"
+ fi
+ echo_cflags=yes
+ ;;
+ --defines)
+ echo_defines=yes
+ ;;
+ --libs)
+ echo_libs=yes
+ ;;
+ --idlflags)
+ echo_idlflags=yes
+ ;;
+ xpcom|js|nspr|gfx|jsj)
+ echo_components="$echo_components $1"
+ echo_libraries="$echo_libraries $1"
+ ;;
+ xpconnect)
+ echo_components="$echo_components $1"
+ ;;
+ "")
+ usage 1 1>&2
+ ;;
+ *)
+ echo_components="$echo_components $1"
+ ;;
+ esac
+ shift
+done
+
+if test "$echo_prefix" = "yes"; then
+ echo $prefix
+fi
+if test "$echo_exec_prefix" = "yes"; then
+ echo $exec_prefix
+fi
+
+if test "$echo_defines" = "yes"; then
+ echo -DHAVE_64BIT_OS=1 -DMOZILLA_VERSION=\"1.7.6\" -DD_INO=d_ino -DSTDC_HEADERS=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_SIGINFO_T=1 -DHAVE_INT16_T=1 -DHAVE_INT32_T=1 -DHAVE_INT64_T=1 -DHAVE_UINT=1 -DHAVE_UNAME_DOMAINNAME_FIELD=1 -DHAVE_VISIBILITY_ATTRIBUTE=1 -DHAVE_DIRENT_H=1 -DHAVE_GETOPT_H=1 -DHAVE_SYS_BITYPES_H=1 -DHAVE_MEMORY_H=1 -DHAVE_UNISTD_H=1 -DHAVE_GNU_LIBC_VERSION_H=1 -DHAVE_NL_TYPES_H=1 -DHAVE_MALLOC_H=1 -DHAVE_X11_XKBLIB_H=1 -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_STATFS_H=1 -DHAVE_SYS_CDEFS_H=1 -DHAVE_LIBM=1 -DHAVE_LIBDL=1 -DFUNCPROTO=15 -DHAVE_XSHM=1 -D_REENTRANT=1 -DHAVE_RANDOM=1 -DHAVE_STRERROR=1 -DHAVE_LCHOWN=1 -DHAVE_FCHMOD=1 -DHAVE_SNPRINTF=1 -DHAVE_MEMMOVE=1 -DHAVE_RINT=1 -DHAVE_FLOCKFILE=1 -DHAVE_LOCALTIME_R=1 -DHAVE_STRTOK_R=1 -DHAVE_RES_NINIT=1 -DHAVE_GNU_GET_LIBC_VERSION=1 -DHAVE_LANGINFO_CODESET=1 -DVA_COPY=va_copy -DHAVE_VA_COPY=1 -DHAVE_VA_LIST_AS_ARRAY=1 -DHAVE_I18N_LC_MESSAGES=1 -DMOZ_DEFAULT_TOOLKIT=\"gtk2\" -DMOZ_WIDGET_GTK2=1 -DMOZ_ENABLE_XREMOTE=1 -DMOZ_X11=1 -DMOZ_DISTRIBUTION_ID_UNQUOTED=org.mozilla -DMOZ_DISTRIBUTION_ID=\"org.mozilla\" -DMOZ_PHOENIX=1 -DMOZ_XUL_APP=1 -DMOZ_APP_NAME=\"firefox\" -DMOZ_ENABLE_XFT=1 -DMOZ_ENABLE_PANGO=1 -DHAVE_LIBPANGOFT2_1_0=1 -DMOZ_ENABLE_COREXFONTS=1 -DMOZ_EXTRA_X11CONVERTERS=1 -DOJI=1 -DMOZ_ENABLE_XINERAMA=1 -DIBMBIDI=1 -DMOZ_VIEW_SOURCE=1 -DACCESSIBILITY=1 -DMOZ_XPINSTALL=1 -DMOZ_JSLOADER=1 -DHAVE_GSSAPI_GSSAPI_H=1 -DHAVE_GSSAPI_GSSAPI_GENERIC_H=1 -DHAVE_GSS_C_NT_HOSTBASED_SERVICE=1 -DMOZ_MATHML=1 -DMOZ_LOGGING=1 -DHAVE___CXA_DEMANGLE=1 -DMOZ_DEFAULT_MOZILLA_FIVE_HOME=\"/usr/lib/mozilla-firefox\" -DMOZ_USER_DIR=\".mozilla\" -DMOZ_XUL=1 -DMOZ_PROFILELOCKING=1 -DMOZ_DLL_SUFFIX=\".so\" -DXP_UNIX=1 -DUNIX_ASYNC_DNS=1 -DJS_THREADSAFE=1 -DNS_PRINT_PREVIEW=1 -DNS_PRINTING=1 -DMOZ_ACCESSIBILITY_ATK=1 -DMOZILLA_LOCALE_VERSION=\"1.7\" -DMOZILLA_REGION_VERSION=\"1.7\" -DMOZILLA_SKIN_VERSION=\"1.5\"
+fi
+
+if test "$echo_cflags" = "yes"; then
+ nspr_cflags="-I/usr/include/mozilla-firefox/nspr"
+ for n in $echo_components; do
+ component_includes="$component_includes -I/usr/include/mozilla-firefox/$n"
+ done
+ echo $component_includes $includes $nspr_cflags
+fi
+
+if test "$echo_idlflags" = "yes"; then
+ echo "-I%{idldir}"
+fi
+
+_nspr_libs="-L/usr/lib/mozilla-firefox -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
+_xpcom_libs="-lxpcom $_nspr_libs"
+_js_libs="-ljs"
+
+if test "$echo_libs" = "yes"; then
+ for l in $echo_libraries; do
+ case "$l" in
+ gfx)
+ libs="$libs -lgkgfx $_xpcom_libs"
+ ;;
+ xpcom)
+ libs="$libs $_xpcom_libs"
+ ;;
+ nspr)
+ libs="$libs $_nspr_libs"
+ ;;
+ js)
+ libs="$libs $_js_libs"
+ ;;
+ jsj)
+ libs="$libs -ljsj $_js_libs $_xpcom_libs"
+ ;;
+ esac
+ done
+ echo -L/usr/lib/mozilla-firefox $libs
+fi
--- nsprpub/lib/tests/Makefile
+++ nsprpub/lib/tests/Makefile
@@ -0,0 +1,255 @@
+# Generated automatically from Makefile.in by configure.
+#
+# 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 Netscape Portable Runtime (NSPR).
+#
+# The Initial Developer of the Original Code is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1998-2000 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the
+# terms of the GNU General Public License Version 2 or later (the
+# "GPL"), in which case the provisions of the GPL are applicable
+# instead of those above. If you wish to allow use of your
+# version of this file only under the terms of the GPL and not to
+# allow others to use your version of this file under the MPL,
+# indicate your decision by deleting the provisions above and
+# replace them with the notice and other provisions required by
+# the GPL. If you do not delete the provisions above, a recipient
+# may use your version of this file under either the MPL or the
+# GPL.
+#
+
+#! gmake
+
+MOD_DEPTH = ../..
+topsrcdir = ../..
+srcdir = .
+
+include $(MOD_DEPTH)/config/autoconf.mk
+
+include $(topsrcdir)/config/config.mk
+
+ifeq ($(OS_ARCH), WINNT)
+# DIRS = windows
+endif
+
+ifeq ($(OS_TARGET), WIN16)
+OS_CFLAGS = $(OS_EXE_CFLAGS)
+endif
+
+CSRCS = \
+ arena.c \
+ string.c \
+ base64t.c
+
+ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
+CSRCS += arena.c
+endif
+
+ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
+PROG_SUFFIX = .exe
+else
+PROG_SUFFIX =
+endif
+
+PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=$(PROG_SUFFIX)))
+
+TARGETS = $(PROGS) $(OBJS)
+
+INCLUDES = -I$(dist_includedir)
+
+# Setting the variables LDOPTS and LIBPR. We first initialize
+# them to the default values, then adjust them for some platforms.
+LDOPTS = -L$(dist_libdir)
+LIBPR = -lnspr$(MOD_MAJOR_VERSION)
+LIBPLC = -lplc$(MOD_MAJOR_VERSION)
+LIBPLDS = -lplds$(MOD_MAJOR_VERSION)
+
+ifeq ($(OS_ARCH), WINNT)
+ifeq ($(OS_TARGET), WIN16)
+ LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
+ LIBPLC= $(dist_libdir)/plc$(MOD_MAJOR_VERSION).lib
+ LIBPLDS= $(dist_libdir)/plds$(MOD_MAJOR_VERSION).lib
+else
+ LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
+ ifeq ($(OS_TARGET), WIN95)
+ LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
+ LIBPLC= $(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
+ LIBPLDS= $(dist_libdir)/plds$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
+ else
+ LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
+ LIBPLC= $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
+ LIBPLDS= $(dist_libdir)/libplds$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
+ endif
+endif
+endif
+
+ifeq ($(OS_ARCH),OS2)
+ ifeq ($(MOZ_OS2_TOOLS),VACPP)
+ LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO /S:32768
+ LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
+ LIBPLC = $(dist_libdir)/plc$(MOD_MAJOR_VERSION).lib
+ LIBPLDS= $(dist_libdir)/plds$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
+ else
+ LDOPTS += -Zomf -Zlinker /PM:VIO
+ endif
+endif
+
+ifneq ($(OS_ARCH), WINNT)
+PWD = $(shell pwd)
+endif
+
+ifeq ($(OS_ARCH), IRIX)
+LDOPTS += -rpath $(PWD)/$(dist_libdir)
+endif
+
+ifeq ($(OS_ARCH), Linux)
+ ifeq ($(OS_RELEASE), 1.2)
+ EXTRA_LIBS = -ldl
+ else
+ LDOPTS += -Xlinker -rpath $(PWD)/$(dist_libdir)
+ ifeq ($(USE_PTHREADS),1)
+ EXTRA_LIBS = -lpthread
+ endif
+ endif
+endif
+
+ifeq ($(OS_ARCH), OSF1)
+LDOPTS += -rpath $(PWD)/$(dist_libdir) -lpthread
+endif
+
+ifeq ($(OS_ARCH), HP-UX)
+LDOPTS += -Wl,+s,+b,$(PWD)/$(dist_libdir)
+endif
+
+# AIX
+ifeq ($(OS_ARCH),AIX)
+LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
+LIBPR = -lnspr$(MOD_MAJOR_VERSION)_shr
+LIBPLC = -lplc$(MOD_MAJOR_VERSION)_shr
+endif
+
+# Solaris
+ifeq ($(OS_ARCH), SunOS)
+ifneq ($(OS_RELEASE), 4.1.3_U1)
+ifdef NS_USE_GCC
+LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
+else
+LDOPTS += -R $(PWD)/$(dist_libdir)
+endif
+endif
+
+# SunOS 5.4 and 5.5 need to link with -lthread or -lpthread,
+# even though we already linked with these system libraries
+# when we built libnspr.so.
+ifeq ($(OS_RELEASE), 5.4)
+EXTRA_LIBS = -lthread
+endif
+
+ifeq ($(OS_RELEASE), 5.5)
+ifdef USE_PTHREADS
+EXTRA_LIBS = -lpthread
+else
+EXTRA_LIBS = -lthread
+endif
+endif
+endif # SunOS
+
+ifeq ($(OS_ARCH), NCR)
+# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
+# implicitly by $(CC)) again even though we already linked with these
+# system libraries when we built libnspr.so.
+EXTRA_LIBS = -lsocket -lnsl
+# This hardcodes in the executable programs the directory to find
+# libnspr.so etc. at program startup. Equivalent to the -R or -rpath
+# option for ld on other platforms.
+export LD_RUN_PATH = $(PWD)/$(dist_libdir)
+endif
+
+#####################################################
+#
+# The rules
+#
+#####################################################
+
+include $(topsrcdir)/config/rules.mk
+
+AIX_PRE_4_2 = 0
+ifeq ($(OS_ARCH),AIX)
+ifneq ($(OS_RELEASE),4.2)
+ifneq ($(USE_PTHREADS), 1)
+#AIX_PRE_4_2 = 1
+endif
+endif
+endif
+
+ifeq ($(AIX_PRE_4_2),1)
+
+# AIX releases prior to 4.2 need a special two-step linking hack
+# in order to both override the system select() and be able to
+# get at the original system select().
+#
+# We use a pattern rule in ns/nspr20/config/rules.mk to generate
+# the .$(OBJ_SUFFIX) file from the .c source file, then do the
+# two-step linking hack below.
+
+$(OBJDIR)/%: $(OBJDIR)/%.$(OBJ_SUFFIX)
+ @$(MAKE_OBJDIR)
+ rm -f $@ $(AIX_TMP)
+ $(CC) $(AIX_LINK_OPTS) -o $(AIX_TMP) $< $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
+ $(CC) -o $@ $(AIX_TMP) $(AIX_WRAP)
+ rm -f $(AIX_TMP)
+
+else
+
+# All platforms that are not AIX pre-4.2.
+
+$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
+ @$(MAKE_OBJDIR)
+
+ifeq ($(OS_ARCH), WINNT)
+ifeq ($(OS_TARGET),WIN16)
+ echo system windows >w16link
+ echo option map >>w16link
+ echo option stack=10K >>w16link
+ echo option heapsize=32K >>w16link
+ echo debug $(DEBUGTYPE) all >>w16link
+ echo name $@ >>w16link
+ echo file >>w16link
+ echo $< >>w16link
+ echo library >>w16link
+ echo $(LIBPR), >>w16link
+ echo $(LIBPLC), >>w16link
+ echo winsock.lib >>w16link
+ wlink @w16link.
+else
+ link $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) wsock32.lib -out:$@
+endif
+else
+ifeq ($(OS_ARCH),OS2)
+ $(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS)
+else
+ $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(EXTRA_LIBS) -o $@
+endif
+endif
+endif
+
+export:: $(TARGETS)
+clean::
+ rm -f $(TARGETS)
+
+
+
--- nsprpub/pkg/linux/Makefile
+++ nsprpub/pkg/linux/Makefile
@@ -0,0 +1,44 @@
+# Generated automatically from Makefile.in by configure.
+#
+# Copyright 2002 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "$Id: Makefile.in,v 1.2.2.1 2003/02/26 06:17:31 wtc%netscape.com Exp $"
+#
+
+MOD_DEPTH = ../..
+topsrcdir = ../..
+srcdir = .
+
+NAME = sun-nspr
+RELEASE = 1
+TOPDIR = /usr/src/redhat
+VERSION = `grep PR_VERSION $(dist_includedir)/prinit.h \
+ | sed -e 's/"$$//' -e 's/.*"//' -e 's/ .*//'`
+
+include $(MOD_DEPTH)/config/autoconf.mk
+
+publish:
+ $(MAKE) clean
+ mkdir -p usr/lib/mps
+ cp -L $(MOD_DEPTH)/dist/lib/* usr/lib/mps
+ mkdir -p usr/include/mps
+ cp -Lr $(MOD_DEPTH)/dist/include/* usr/include/mps
+ tar czvf $(NAME)-$(VERSION).tar.gz usr
+ echo "%define name $(NAME)" >$(NAME).spec
+ echo "%define version $(VERSION)" >>$(NAME).spec
+ echo "%define release $(RELEASE)" >>$(NAME).spec
+
+ cat $(srcdir)/$(NAME).spec >>$(NAME).spec
+ cp $(NAME)-$(VERSION).tar.gz $(TOPDIR)/SOURCES
+ rpm -ba $(NAME).spec
+ if [ ! -d RPMS ] ; then mkdir -p RPMS ; fi
+ if [ ! -d SRPMS ] ; then mkdir -p SRPMS ; fi
+ cp -v $(TOPDIR)/RPMS/i386/$(NAME)-$(VERSION)-* RPMS
+ cp -v $(TOPDIR)/RPMS/i386/$(NAME)-devel-$(VERSION)-* RPMS
+ cp -v $(TOPDIR)/SRPMS/$(NAME)-$(VERSION)-* SRPMS
+
+clean:
+ rm -rf $(TOPDIR)/BUILD/$(NAME)
+ rm -rf RPMS SRPMS usr
+ rm -f $(NAME)-$(VERSION).tar.gz
--- nsprpub/pkg/solaris/SUNWpr/Makefile
+++ nsprpub/pkg/solaris/SUNWpr/Makefile
@@ -0,0 +1,22 @@
+# Generated automatically from Makefile.in by configure.
+#
+# Copyright 2002 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "$Id: Makefile.in,v 1.1.2.1 2003/01/07 15:29:37 wtc%netscape.com Exp $"
+#
+
+MOD_DEPTH = ../../..
+topsrcdir = ../../..
+srcdir = .
+
+include $(MOD_DEPTH)/config/autoconf.mk
+
+include $(srcdir)/../Makefile.com
+
+DATAFILES +=
+
+all:: $(FILES)
+publish:: all pkg
+
+include $(srcdir)/../Makefile.targ
--- nsprpub/pkg/solaris/SUNWprx/Makefile
+++ nsprpub/pkg/solaris/SUNWprx/Makefile
@@ -0,0 +1,22 @@
+# Generated automatically from Makefile.in by configure.
+#
+# Copyright 2002 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "$Id: Makefile.in,v 1.1.2.1 2003/01/07 15:29:43 wtc%netscape.com Exp $"
+#
+
+MOD_DEPTH = ../../..
+topsrcdir = ../../..
+srcdir = .
+
+include $(MOD_DEPTH)/config/autoconf.mk
+
+include $(srcdir)/../Makefile.com
+
+DATAFILES +=
+
+all:: $(FILES)
+publish:: all pkg
+
+include $(srcdir)/../Makefile.targ
--- nsprpub/pkg/solaris/Makefile
+++ nsprpub/pkg/solaris/Makefile
@@ -0,0 +1,60 @@
+# Generated automatically from Makefile.in by configure.
+#
+# Copyright 2002 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "$Id: Makefile.in,v 1.1.2.1 2003/01/07 15:29:33 wtc%netscape.com Exp $"
+#
+
+MOD_DEPTH = ../..
+topsrcdir = ../..
+srcdir = .
+
+include $(MOD_DEPTH)/config/autoconf.mk
+
+%: %.ksh
+ $(RM) $@
+ cp $< $@
+ chmod +x $@
+
+ifeq ($(USE_64), 1)
+DIRS = \
+ SUNWprx
+else
+DIRS = \
+ SUNWpr
+endif
+
+PROTO = \
+ $(ROOT) \
+ $(ROOT)/usr \
+ $(ROOT)/usr/lib \
+ $(ROOT)/usr/lib/mps
+
+ifdef USE_64
+PROTO += $(ROOT)/usr/lib/mps/sparcv9
+endif
+
+include $(srcdir)/Makefile.com
+
+awk_pkginfo: bld_awk_pkginfo
+ ./bld_awk_pkginfo -m $(MACH) -p "$(PRODUCT_VERSION)" -o $@ -v $(PRODUCT_VERSION)
+
+all:: awk_pkginfo $(PROTO)
+publish: awk_pkginfo $(PROTO)
+ +$(LOOP_OVER_DIRS)
+
+clean clobber::
+ $(RM) awk_pkginfo bld_awk_pkginfo
+ $(RM) -r $(ROOT)
+
+$(ROOT) $(ROOT)/%:
+ mkdir -p $@
+
+ifdef USE_64
+$(ROOT)/usr/lib/mps/sparcv9:
+ $(LN) -sf ../../../../$(dist_libdir) $@
+else
+$(ROOT)/usr/lib/mps:
+ $(LN) -sf ../../../$(dist_libdir) $@
+endif
--- nsprpub/pkg/Makefile
+++ nsprpub/pkg/Makefile
@@ -0,0 +1,54 @@
+# Generated automatically from Makefile.in by configure.
+#
+# 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 Netscape Portable Runtime (NSPR).
+#
+# The Initial Developer of the Original Code is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1998-2000 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the
+# terms of the GNU General Public License Version 2 or later (the
+# "GPL"), in which case the provisions of the GPL are applicable
+# instead of those above. If you wish to allow use of your
+# version of this file only under the terms of the GPL and not to
+# allow others to use your version of this file under the MPL,
+# indicate your decision by deleting the provisions above and
+# replace them with the notice and other provisions required by
+# the GPL. If you do not delete the provisions above, a recipient
+# may use your version of this file under either the MPL or the
+# GPL.
+#
+
+#! gmake
+
+MOD_DEPTH = ..
+topsrcdir = ..
+srcdir = .
+
+include $(MOD_DEPTH)/config/autoconf.mk
+
+DIRS =
+ifeq ($(OS_TARGET),Linux)
+DIRS = linux
+endif
+ifeq ($(OS_TARGET),SunOS)
+DIRS = solaris
+endif
+
+publish::
+ +$(LOOP_OVER_DIRS)
+
+include $(topsrcdir)/config/rules.mk
--- security/nss/lib/freebl/unix_rand.c
+++ security/nss/lib/freebl/unix_rand.c
@@ -875,12 +875,14 @@
safe_pclose(fp);
}
#endif
+#ifndef LINUX
fp = safe_popen(netstat_ni_cmd);
if (fp != NULL) {
while ((bytes = fread(buf, 1, sizeof(buf), fp)) > 0)
RNG_RandomUpdate(buf, bytes);
safe_pclose(fp);
}
+#endif
}
#else
--- security/coreconf/Linux.mk
+++ security/coreconf/Linux.mk
@@ -69,6 +69,8 @@
ifeq ($(OS_TEST),x86_64)
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
CPU_ARCH = x86_64
+ CC = gcc-3.4
+ CCC = g++-3.4
else
ifeq ($(OS_TEST),sparc)
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
--- security/manager/boot/src/nsSecureBrowserUIImpl.cpp
+++ security/manager/boot/src/nsSecureBrowserUIImpl.cpp
@@ -1325,6 +1325,10 @@
rv = internal->GetPrompter(&prompt);
*result = prompt;
+ } else if (uuid.Equals(NS_GET_IID(nsIDOMWindow))) {
+ *result = mWindow;
+ NS_ADDREF ((nsISupports*) *result);
+ rv = NS_OK;
} else {
rv = NS_ERROR_NO_INTERFACE;
}
--- modules/libpr0n/build/_img_list
+++ modules/libpr0n/build/_img_list
@@ -0,0 +1 @@
+png gif jpeg bmp xbm icon
--- modules/libpr0n/decoders/icon/win/nsIconChannel.h
+++ modules/libpr0n/decoders/icon/win/nsIconChannel.h
@@ -45,7 +45,7 @@
NS_DECL_NSISTREAMLISTENER
nsIconChannel();
- virtual ~nsIconChannel();
+ ~nsIconChannel();
nsresult Init(nsIURI* uri);
--- modules/libpr0n/decoders/icon/Makefile.in
+++ modules/libpr0n/decoders/icon/Makefile.in
@@ -35,6 +35,13 @@
PACKAGE_FILE = imgicon.pkg
+ifdef MOZ_ENABLE_GNOMEUI
+EXTRA_DSO_LDOPTS = $(MOZ_GNOMEUI_LIBS)
+PLATFORM = gtk
+FORCE_SHARED_LIB = 1
+EXPORT_LIBRARY =
+endif
+
ifeq ($(OS_ARCH),WINNT)
EXTRA_DSO_LIBS = gkgfx
PLATFORM = win
@@ -48,6 +55,10 @@
PLATFORM = mac
endif
+ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
+PLATFORM = gtk
+endif
+
DIRS = $(PLATFORM)
REQUIRES = xpcom \
@@ -68,7 +79,7 @@
SHARED_LIBRARY_LIBS = $(DIST)/lib/$(LIB_PREFIX)imgicon$(PLATFORM)_s.$(LIB_SUFFIX)
-EXTRA_DSO_LDOPTS = \
+EXTRA_DSO_LDOPTS += \
$(EXTRA_DSO_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
--- modules/libpr0n/decoders/icon/nsIIconURI.idl
+++ modules/libpr0n/decoders/icon/nsIIconURI.idl
@@ -21,26 +21,90 @@
#include "nsIURI.idl"
-//
-// moz-icon URLs have the following syntax
-//
-// moz-icon:?size=16&contentType=text/html
-// OR
-// moz-icon://dummyfile.html
-// moz-icon://dummyfile.html?size=32
-//
-// The content type field is optional. The size field is optional. You only need to specify a file url inside the icon
-// if the file you want the icon for actually exists. Otherwise you can omit the file:// and just place a dummy file name with the extension
-// or content type you want: moz-icon://dummy.html.
-//
+ /**
+ * nsIIconURI
+ *
+ * This interface derives from nsIURI, to provide additional information
+ * about moz-icon URIs. These URIs
+ *
+ * What *is* a moz-icon URI you ask? Well, it has the following syntax:
+ *
+ * moz-icon://[ | ]? ['?'[]]
+ *
+ * is a legal file: URI spec. You only need to specify a file: URI inside the icon
+ * if the file you want the icon for actually exists.
+ *
+ * is any filename with an extension, e.g. "dummy.html".
+ * If the file you want an icon for isn't known to exist, you can omit the file URI, and just
+ * place a dummy file name with the extension or content type you want: moz-icon://dummy.html.
+ *
+ * is of the format: stock/
+ *
+ * is a valid icon name, such as 'ok', 'cancel', 'yes', 'no'.
+ * XXXcaa document or reference to all 76 (yes, 76) of them.
+ *
+ * Legal parameter value pairs are listed below:
+ *
+ * Parameter: size
+ * Values: [ | button | toolbar | toolbarsmall | menu | dialog]
+ * Description: If integer, this is the desired size in square pixels of the icon
+ * Else, use the OS default for the specified keyword context.
+ * Note that stock images require a keyword, not an integer pixel value.
+ *
+ * Parameter: contentType
+ * Values:
+ * Description: A valid mime type for the icon.
+ */
[scriptable, uuid(733A7A16-2D36-11d5-9907-001083010E9B)]
interface nsIMozIconURI : nsIURI
{
- // Returns the file URL contained within this -moz-icon url.
- attribute nsIURI IconFile; // maybe null if there isn't a real file we are trying to fetch
+ /**
+ * iconFile
+ *
+ * the file URL contained within this moz-icon url, or null.
+ */
+ attribute nsIURI iconFile;
+ /**
+ * imageSize
+ *
+ * The image area in square pixels, defaulting to 16 if unspecified.
+ */
+ attribute unsigned long imageSize;
- attribute unsigned long imageSize; // measured by # of pixels in a row. defaults to 16.
- attribute ACString contentType; // may be an empty string
+ /**
+ * contentType
+ *
+ * A valid mime type, or the empty string.
+ */
+
+ attribute ACString contentType;
+
+ /**
+ * fileExtension
+ *
+ * The file extension of the file which we are looking up.
+ */
readonly attribute ACString fileExtension;
+
+ /**
+ * stockIcon
+ *
+ * The stock icon name requested from the OS.
+ */
+ readonly attribute ACString stockIcon;
+
+ /**
+ * stockIconSize
+ *
+ * The stock icon size requested from the OS.
+ */
+ readonly attribute ACString stockIconSize;
+
+ /**
+ * stockIconState
+ *
+ * The stock icon state requested from the OS.
+ */
+ readonly attribute ACString stockIconState;
};
--- modules/libpr0n/decoders/icon/nsIconModule.cpp
+++ modules/libpr0n/decoders/icon/nsIconModule.cpp
@@ -26,6 +26,7 @@
#include "nsIconDecoder.h"
#include "nsIconProtocolHandler.h"
+#include "nsIconURI.h"
// objects that just require generic constructors
/******************************************************************************
@@ -41,7 +42,8 @@
{ "icon decoder",
NS_ICONDECODER_CID,
"@mozilla.org/image/decoder;2?type=image/icon",
- nsIconDecoderConstructor, },
+ nsIconDecoderConstructor
+ },
{ "Icon Protocol Handler",
NS_ICONPROTOCOL_CID,
@@ -50,4 +52,12 @@
}
};
-NS_IMPL_NSGETMODULE(nsIconDecoderModule, components)
+PR_STATIC_CALLBACK(nsresult)
+IconDecoderModuleCtor(nsIModule* aSelf)
+{
+ nsMozIconURI::InitAtoms();
+ return NS_OK;
+}
+
+NS_IMPL_NSGETMODULE_WITH_CTOR(nsIconDecoderModule, components,
+ IconDecoderModuleCtor)
--- modules/libpr0n/decoders/icon/nsIconProtocolHandler.cpp
+++ modules/libpr0n/decoders/icon/nsIconProtocolHandler.cpp
@@ -89,15 +89,18 @@
NS_IMETHODIMP nsIconProtocolHandler::NewChannel(nsIURI* url, nsIChannel* *result)
{
- nsCOMPtr channel;
- NS_NEWXPCOM(channel, nsIconChannel);
+ nsIconChannel* channel = new nsIconChannel;
+ if (!channel)
+ return NS_ERROR_OUT_OF_MEMORY;
+ NS_ADDREF(channel);
- if (channel)
- NS_STATIC_CAST(nsIconChannel*,NS_STATIC_CAST(nsIChannel*, channel))->Init(url);
+ nsresult rv = channel->Init(url);
+ if (NS_FAILED(rv)) {
+ delete channel;
+ return rv;
+ }
*result = channel;
- NS_IF_ADDREF(*result);
-
return NS_OK;
}
--- modules/libpr0n/decoders/icon/nsIconURI.cpp
+++ modules/libpr0n/decoders/icon/nsIconURI.cpp
@@ -26,6 +26,8 @@
#include "nsCRT.h"
#include "nsReadableUtils.h"
#include "nsPrintfCString.h"
+#include "nsIAtom.h"
+#include "nsStaticAtom.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#define DEFAULT_IMAGE_SIZE 16
@@ -34,17 +36,48 @@
// from the icon url.
static void extractAttributeValue(const char * searchString, const char * attributeName, char ** result);
+static nsIAtom *sStockSizeButton = nsnull;
+static nsIAtom *sStockSizeToolbar = nsnull;
+static nsIAtom *sStockSizeToolbarsmall = nsnull;
+static nsIAtom *sStockSizeMenu = nsnull;
+static nsIAtom *sStockSizeDialog = nsnull;
+static nsIAtom *sStockStateNormal = nsnull;
+static nsIAtom *sStockStateDisabled = nsnull;
+
+/* static */ const nsStaticAtom nsMozIconURI::sSizeAtoms[] =
+{
+ { "button", &sStockSizeButton },
+ { "toolbar", &sStockSizeToolbar },
+ { "toolbarsmall", &sStockSizeToolbarsmall },
+ { "menu", &sStockSizeMenu },
+ { "dialog", &sStockSizeDialog }
+};
+
+/* static */ const nsStaticAtom nsMozIconURI::sStateAtoms[] =
+{
+ { "normal", &sStockStateNormal },
+ { "disabled", &sStockStateDisabled }
+};
+
////////////////////////////////////////////////////////////////////////////////
nsMozIconURI::nsMozIconURI()
+ : mSize(DEFAULT_IMAGE_SIZE)
{
- mSize = DEFAULT_IMAGE_SIZE;
}
nsMozIconURI::~nsMozIconURI()
{
}
+
+/* static */ void
+nsMozIconURI::InitAtoms()
+{
+ NS_RegisterStaticAtoms(sSizeAtoms, NS_ARRAY_LENGTH(sSizeAtoms));
+ NS_RegisterStaticAtoms(sStateAtoms, NS_ARRAY_LENGTH(sStateAtoms));
+}
+
NS_IMPL_THREADSAFE_ISUPPORTS2(nsMozIconURI, nsIMozIconURI, nsIURI)
#define NS_MOZICON_SCHEME "moz-icon:"
@@ -64,6 +97,26 @@
NS_ENSURE_SUCCESS(rv, rv);
spec += fileIconSpec;
}
+ else if (!mStockIcon.IsEmpty())
+ {
+ spec += "//stock/";
+ spec += mStockIcon;
+ if (mStockIconSize) {
+ spec += NS_MOZ_ICON_DELIMITER;
+ spec += "size=";
+ const char *size_string;
+ mStockIconSize->GetUTF8String(&size_string);
+ spec.Append(nsPrintfCString("%s", size_string));
+ }
+ if (mStockIconState) {
+ spec += NS_MOZ_ICON_DELIMITER;
+ spec += "state=";
+ const char *state_string;
+ mStockIconSize->GetUTF8String(&state_string);
+ spec.Append(nsPrintfCString("%s", state_string));
+ }
+ return NS_OK;
+ }
else
{
spec += "//";
@@ -116,12 +169,10 @@
else // there is nothing left so eat up rest of line.
attributeValue = PL_strdup(startOfAttribute);
} // if we have a attribute value
-
} // if we have a attribute name
} // if we got non-null search string and attribute name values
*result = attributeValue; // passing ownership of attributeValue into result...no need to
- return;
}
NS_IMETHODIMP
@@ -138,6 +189,8 @@
if (strcmp("moz-icon", scheme.get()) != 0)
return NS_ERROR_MALFORMED_URI;
+ nsXPIDLCString sizeString;
+ nsXPIDLCString stateString;
nsCAutoString mozIconPath(aSpec);
PRInt32 endPos = mozIconPath.FindChar(':') + 1; // guaranteed to exist!
PRInt32 pos = mozIconPath.FindChar(NS_MOZ_ICON_DELIMITER);
@@ -150,26 +203,48 @@
{
mozIconPath.Mid(mDummyFilePath, endPos, pos - endPos);
// fill in any size and content type values...
- nsXPIDLCString sizeString;
nsXPIDLCString contentTypeString;
extractAttributeValue(mozIconPath.get() + pos, "size=", getter_Copies(sizeString));
+ extractAttributeValue(mozIconPath.get() + pos, "state=", getter_Copies(stateString));
extractAttributeValue(mozIconPath.get() + pos, "contentType=", getter_Copies(contentTypeString));
mContentType = contentTypeString;
-
- if (sizeString.get())
- {
- PRInt32 sizeValue = atoi(sizeString);
- // if the size value we got back is > 0 then use it
- if (sizeValue)
- mSize = sizeValue;
- }
}
- // Okay now we have a bit of a hack here...filePath can have two forms:
+ // Okay now we have a bit of a hack here...filePath can have three forms:
// (1) file://
// (2) //
+ // (3) stock/
// We need to determine which case we are and behave accordingly...
- if (mDummyFilePath.Length() > 2) // we should at least have two forward slashes followed by a file or a file://
+ if (mDummyFilePath.Length() > 2)
+ {
+ if (!strncmp("//stock/", mDummyFilePath.get(), 8))
+ {
+ // we have a stock icon
+ mStockIcon = Substring(mDummyFilePath, 8);
+ if (!sizeString.IsEmpty())
+ {
+ nsCOMPtr atom = do_GetAtom(sizeString);
+ for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(sSizeAtoms); i++)
+ {
+ if (atom == *(sSizeAtoms[i].mAtom))
+ {
+ mStockIconSize = atom;
+ break;
+ }
+ }
+
+ atom = do_GetAtom(stateString);
+ for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(sStateAtoms); i++)
+ {
+ if (atom == *(sStateAtoms[i].mAtom))
+ {
+ mStockIconState = atom;
+ break;
+ }
+ }
+ }
+ }
+ else
{
if (!nsCRT::strncmp("//", mDummyFilePath.get(), 2))// must not have a url here..
{
@@ -177,16 +252,22 @@
// and remember the rest in mDummyFilePath
mDummyFilePath.Cut(0, 2); // cut the first 2 bytes....
}
-
- if (!nsCRT::strncmp("file://", mDummyFilePath.get(), 7))
+ else if (!nsCRT::strncmp("file://", mDummyFilePath.get(), 7))
{
// we have a file url.....so store it...
rv = ioService->NewURI(mDummyFilePath, nsnull, nsnull, getter_AddRefs(mFileIcon));
- if (NS_FAILED(rv)) return NS_ERROR_MALFORMED_URI;
+ }
+ if (!sizeString.IsEmpty())
+ {
+ PRInt32 sizeValue = atoi(sizeString);
+ // if the size value we got back is > 0 then use it
+ if (sizeValue)
+ mSize = sizeValue;
+ }
}
}
else
- return NS_ERROR_MALFORMED_URI; // they didn't include a file path...
+ rv = NS_ERROR_MALFORMED_URI; // they didn't include a file path...
return rv;
}
@@ -436,10 +517,35 @@
const char * chFileName = fileExtension.get(); // get the underlying buffer
const char * fileExt = strrchr(chFileName, '.');
if (!fileExt) return NS_ERROR_FAILURE; // no file extension to work from.
- else
+
aFileExtension = nsDependentCString(fileExt);
return NS_OK;
}
+NS_IMETHODIMP
+nsMozIconURI::GetStockIcon(nsACString &aStockIcon)
+{
+ aStockIcon.Assign(mStockIcon);
+
+ return NS_OK;
+}
+
+NS_IMETHODIMP
+nsMozIconURI::GetStockIconSize(nsACString &aSize)
+{
+ if (mStockIconSize)
+ return mStockIconSize->ToUTF8String(aSize);
+ aSize.Truncate();
+ return NS_OK;
+}
+
+NS_IMETHODIMP
+nsMozIconURI::GetStockIconState(nsACString &aState)
+{
+ if (mStockIconState)
+ return mStockIconState->ToUTF8String(aState);
+ aState.Truncate();
+ return NS_OK;
+}
////////////////////////////////////////////////////////////////////////////////
--- modules/libpr0n/decoders/icon/nsIconURI.h
+++ modules/libpr0n/decoders/icon/nsIconURI.h
@@ -25,6 +25,9 @@
#include "nsIIconURI.h"
#include "nsCOMPtr.h"
#include "nsString.h"
+class nsStaticAtom;
+
+class nsIAtom;
#define NS_MOZICONURI_CID \
{ \
@@ -41,6 +44,8 @@
NS_DECL_NSIURI
NS_DECL_NSIMOZICONURI
+ static void InitAtoms();
+
// nsJARURI
nsMozIconURI();
virtual ~nsMozIconURI();
@@ -50,6 +55,12 @@
PRUint32 mSize; // the # of pixels in a row that we want for this image. Typically 16, 32, 128, etc.
nsCString mContentType; // optional field explicitly specifying the content type
nsCString mDummyFilePath; // if we don't have a valid file url, the file path is stored here....i.e if mFileIcon is null.....
+ nsCString mStockIcon;
+ nsCOMPtr mStockIconSize;
+ nsCOMPtr mStockIconState;
+
+ static const nsStaticAtom sSizeAtoms[];
+ static const nsStaticAtom sStateAtoms[];
nsresult FormatSpec(nsACString &result);
};
--- modules/libpr0n/decoders/icon/gtk/Makefile.in
+++ modules/libpr0n/decoders/icon/gtk/Makefile.in
@@ -0,0 +1,63 @@
+# ***** 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 Makefile for the Gnome icon decoder.
+#
+# The Initial Developer of the Original Code is
+# Christian Biesinger .
+# Portions created by the Initial Developer are Copyright (C) 2004
+# the Initial Developer. All Rights Reserved.
+#
+# 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 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 = imgicon
+LIBRARY_NAME = imgicongtk_s
+
+REQUIRES = xpcom \
+ string \
+ necko \
+ intl \
+ mimetype \
+ $(NULL)
+
+CPPSRCS = nsIconChannel.cpp
+
+LOCAL_INCLUDES += $(MOZ_GNOMEUI_CFLAGS) $(MOZ_GTK2_CFLAGS)
+
+# we don't want the shared lib, but we want to force the creation of a static lib.
+FORCE_STATIC_LIB = 1
+
+include $(topsrcdir)/config/rules.mk
+
--- modules/libpr0n/decoders/icon/gtk/nsIconChannel.h
+++ modules/libpr0n/decoders/icon/gtk/nsIconChannel.h
@@ -0,0 +1,84 @@
+/* ***** 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 icon channel for gnome.
+ *
+ * The Initial Developer of the Original Code is
+ * Christian Biesinger .
+ * Portions created by the Initial Developer are Copyright (C) 2004
+ * the Initial Developer. All Rights Reserved.
+ *
+ * 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 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 nsIconChannel_h_
+#define nsIconChannel_h_
+
+#include "nsIChannel.h"
+#include "nsIStreamListener.h"
+#include "nsIURI.h"
+#include "nsIIconURI.h"
+#include "nsCOMPtr.h"
+
+/**
+ * This class is the gnome implementation of nsIconChannel. It basically asks
+ * gtk/gnome for an icon, saves it as a tmp icon, and creates a new channel for
+ * that file to which all calls will be proxied.
+ */
+class nsIconChannel : public nsIChannel
+{
+ public:
+ NS_DECL_ISUPPORTS
+ NS_FORWARD_NSIREQUEST(mRealChannel->)
+ NS_FORWARD_NSICHANNEL(mRealChannel->)
+
+ nsIconChannel() {}
+ ~nsIconChannel() {}
+
+ /**
+ * Called by nsIconProtocolHandler after it creates this channel.
+ * Must be called before calling any other function on this object.
+ * If this method fails, no other function must be called on this object.
+ */
+ NS_HIDDEN_(nsresult) Init(nsIURI* aURI);
+ private:
+ /**
+ * The channel to the temp icon file (e.g. to /tmp/2qy9wjqw.html).
+ * Will always be non-null after a successful Init.
+ */
+ nsCOMPtr mRealChannel;
+ /**
+ * The moz-icon URI we're loading. Always non-null after a successful Init.
+ */
+ nsCOMPtr mURI;
+
+ /**
+ * Called by Init if we need to use the gnomeui library.
+ */
+ nsresult InitWithGnome();
+};
+
+#endif
--- modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp
+++ modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp
@@ -0,0 +1,352 @@
+/* vim:set ts=2 sw=2 sts=2 cin et: */
+/* ***** 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 icon channel for gnome.
+ *
+ * The Initial Developer of the Original Code is
+ * Christian Biesinger .
+ * Portions created by the Initial Developer are Copyright (C) 2004
+ * the Initial Developer. All Rights Reserved.
+ *
+ * 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 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
+#include
+// Older versions of these headers seem to be missing an extern "C"
+extern "C" {
+#include
+#include
+#include
+#include
+
+#include
+#include
+}
+
+#include
+#include
+
+#include "nsIMIMEService.h"
+
+#include "nsIStringBundle.h"
+
+#include "nsEscape.h"
+#include "nsNetUtil.h"
+#include "nsIURL.h"
+#include "prlink.h"
+#include "nsIconChannel.h"
+
+NS_IMPL_ISUPPORTS2(nsIconChannel, nsIRequest, nsIChannel)
+
+/**
+ * Given a path to a PNG Image, creates a channel from it.
+ * Note that the channel will delete the file when it's done with it.
+ *
+ * (When this function fails, the file will NOT be deleted)
+ */
+static nsresult pngfile_to_channel(const char* aFilename, nsIChannel** aChannel) {
+ // Now we have to create an uri for the file...
+ nsCOMPtr lf;
+ nsresult rv = NS_NewNativeLocalFile(nsDependentCString(aFilename), PR_FALSE,
+ getter_AddRefs(lf));
+ if (NS_FAILED(rv))
+ return rv;
+
+ nsCOMPtr is;
+ rv = NS_NewLocalFileInputStream(getter_AddRefs(is), lf, -1, -1,
+ nsIFileInputStream::DELETE_ON_CLOSE);
+ if (NS_FAILED(rv))
+ return rv;
+
+ nsCOMPtr realURI;
+ rv = NS_NewFileURI(getter_AddRefs(realURI), lf);
+ if (NS_FAILED(rv))
+ return rv;
+
+ rv = NS_NewInputStreamChannel(aChannel, realURI, is,
+ NS_LITERAL_CSTRING("image/png"));
+ return rv;
+}
+
+static nsresult
+moz_gdk_pixbuf_to_channel(GdkPixbuf* aPixbuf, nsIChannel **aChannel)
+{
+ char tmpfile[] = "/tmp/moziconXXXXXX";
+ int fd = mkstemp(tmpfile);
+ if (fd == -1) {
+ return NS_ERROR_UNEXPECTED;
+ }
+
+ GError *err = NULL;
+ gboolean ok = gdk_pixbuf_save(aPixbuf, tmpfile, "png", &err, NULL);
+ if (!ok) {
+ close(fd);
+ remove(tmpfile);
+ if (err)
+ g_error_free(err);
+ return NS_ERROR_UNEXPECTED;
+ }
+
+ nsresult rv = pngfile_to_channel(tmpfile, aChannel);
+ close(fd);
+ if (NS_FAILED(rv))
+ remove(tmpfile);
+ return rv;
+}
+
+static GtkWidget *gProtoWindow = nsnull;
+static GtkWidget *gStockImageWidget = nsnull;
+static GtkIconFactory *gIconFactory = nsnull;
+
+static void
+ensure_stock_image_widget()
+{
+ if (!gProtoWindow) {
+ gProtoWindow = gtk_window_new(GTK_WINDOW_POPUP);
+ gtk_widget_realize(gProtoWindow);
+ GtkWidget* protoLayout = gtk_fixed_new();
+ gtk_container_add(GTK_CONTAINER(gProtoWindow), protoLayout);
+
+ gStockImageWidget = gtk_image_new();
+ gtk_container_add(GTK_CONTAINER(protoLayout), gStockImageWidget);
+ gtk_widget_realize(gStockImageWidget);
+ }
+}
+
+static void
+ensure_icon_factory()
+{
+ if (!gIconFactory) {
+ gIconFactory = gtk_icon_factory_new();
+ gtk_icon_factory_add_default (gIconFactory);
+ g_object_unref(gIconFactory);
+ }
+}
+
+static GtkIconSize
+moz_gtk_icon_size(const char *name)
+{
+ if (strcmp(name, "button") == 0)
+ return GTK_ICON_SIZE_BUTTON;
+
+ if (strcmp(name, "menu") == 0)
+ return GTK_ICON_SIZE_MENU;
+
+ if (strcmp(name, "toolbar") == 0)
+ return GTK_ICON_SIZE_LARGE_TOOLBAR;
+
+ if (strcmp(name, "toolbarsmall") == 0)
+ return GTK_ICON_SIZE_SMALL_TOOLBAR;
+
+ if (strcmp(name, "dialog") == 0)
+ return GTK_ICON_SIZE_DIALOG;
+
+ return GTK_ICON_SIZE_INVALID;
+}
+
+nsresult
+nsIconChannel::InitWithGnome()
+{
+ if (!gnome_program_get()) {
+ // Get the brandShortName from the string bundle to pass to GNOME
+ // as the application name. This may be used for things such as
+ // the title of grouped windows in the panel.
+ nsCOMPtr bundleService =
+ do_GetService(NS_STRINGBUNDLE_CONTRACTID);
+
+ NS_ASSERTION(bundleService, "String bundle service must be present!");
+
+ nsCOMPtr bundle;
+ bundleService->CreateBundle("chrome://global/locale/brand.properties",
+ getter_AddRefs(bundle));
+ nsXPIDLString appName;
+
+ if (bundle) {
+ bundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
+ getter_Copies(appName));
+ } else {
+ NS_WARNING("brand.properties not present, using default application name");
+ appName.Assign(NS_LITERAL_STRING("Gecko"));
+ }
+
+ char* empty[] = { "" };
+ gnome_init(NS_ConvertUTF16toUTF8(appName).get(), "1.0", 1, empty);
+ }
+
+ PRUint32 iconSize;
+ nsresult rv = mURI->GetImageSize(&iconSize);
+ NS_ASSERTION(NS_SUCCEEDED(rv), "GetImageSize failed");
+
+ nsCAutoString type;
+ mURI->GetContentType(type);
+
+ GnomeVFSFileInfo fileInfo = {0};
+ fileInfo.refcount = 1; // In case some GnomeVFS function addrefs and releases it
+
+ nsCAutoString spec;
+ nsCOMPtr fileURI;
+ rv = mURI->GetIconFile(getter_AddRefs(fileURI));
+ if (fileURI) {
+ fileURI->GetAsciiSpec(spec);
+ // Only ask gnome-vfs for a GnomeVFSFileInfo for file: uris, to avoid a
+ // network request
+ PRBool isFile;
+ if (NS_SUCCEEDED(fileURI->SchemeIs("file", &isFile)) && isFile) {
+ gnome_vfs_get_file_info(spec.get(), &fileInfo, GNOME_VFS_FILE_INFO_DEFAULT);
+ }
+ else {
+ // We have to get a leaf name from our uri...
+ nsCOMPtr url(do_QueryInterface(fileURI));
+ if (url) {
+ nsCAutoString name;
+ // The filename we get is UTF-8-compatible, which matches gnome expectations.
+ // See also: http://lists.gnome.org/archives/gnome-vfs-list/2004-March/msg00049.html
+ // "Whenever we can detect the charset used for the URI type we try to
+ // convert it to/from utf8 automatically inside gnome-vfs."
+ // I'll interpret that as "otherwise, this field is random junk".
+ url->GetFileName(name);
+ fileInfo.name = g_strdup(name.get());
+ }
+ // If this is no nsIURL, nothing we can do really.
+
+ if (!type.IsEmpty()) {
+ fileInfo.valid_fields = GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE;
+ fileInfo.mime_type = g_strdup(type.get());
+ }
+ }
+ }
+
+
+ if (type.IsEmpty()) {
+ nsCOMPtr ms(do_GetService("@mozilla.org/mime;1"));
+ if (ms) {
+ nsCAutoString fileExt;
+ mURI->GetFileExtension(fileExt);
+ nsXPIDLCString extType;
+ ms->GetTypeFromExtension(fileExt.get(), getter_Copies(extType));
+ fileExt.Assign(extType);
+ }
+ }
+
+ // Get the icon theme
+ GnomeIconTheme *t = gnome_icon_theme_new();
+ if (!t) {
+ gnome_vfs_file_info_clear(&fileInfo);
+ return NS_ERROR_NOT_AVAILABLE;
+ }
+
+
+ char* name = gnome_icon_lookup(t, NULL, spec.get(), NULL, &fileInfo, type.get(), GNOME_ICON_LOOKUP_FLAGS_NONE, NULL);
+ gnome_vfs_file_info_clear(&fileInfo);
+ if (!name) {
+ g_object_unref(G_OBJECT(t));
+ return NS_ERROR_NOT_AVAILABLE;
+ }
+
+ char* file = gnome_icon_theme_lookup_icon(t, name, iconSize, NULL, NULL);
+ g_free(name);
+ g_object_unref(G_OBJECT(t));
+ if (!file)
+ return NS_ERROR_NOT_AVAILABLE;
+
+ // Create a GdkPixbuf buffer and scale it
+ GError *err = nsnull;
+ GdkPixbuf* buf = gdk_pixbuf_new_from_file(file, &err);
+ g_free(file);
+ if (!buf) {
+ if (err)
+ g_error_free(err);
+ return NS_ERROR_UNEXPECTED;
+ }
+
+ // scale...
+ GdkPixbuf* scaled = gdk_pixbuf_scale_simple(buf, iconSize, iconSize, GDK_INTERP_BILINEAR);
+ gdk_pixbuf_unref(buf);
+ if (!scaled)
+ return NS_ERROR_OUT_OF_MEMORY;
+
+ rv = moz_gdk_pixbuf_to_channel(scaled, getter_AddRefs(mRealChannel));
+ gdk_pixbuf_unref(scaled);
+ return rv;
+}
+
+nsresult
+nsIconChannel::Init(nsIURI* aURI) {
+ mURI = do_QueryInterface(aURI);
+ NS_ASSERTION(mURI, "URI passed to nsIconChannel is no nsIMozIconURI!");
+
+ nsCAutoString stockIcon;
+ mURI->GetStockIcon(stockIcon);
+ if (stockIcon.IsEmpty()) {
+ return InitWithGnome();
+ }
+
+ nsCAutoString iconSizeString;
+ mURI->GetStockIconSize(iconSizeString);
+
+ nsCAutoString iconStateString;
+ mURI->GetStockIconState(iconStateString);
+
+ GtkIconSize icon_size = moz_gtk_icon_size(iconSizeString.get());
+ if (icon_size == GTK_ICON_SIZE_INVALID) {
+ NS_WARNING(iconSizeString.get());
+ return NS_ERROR_FAILURE;
+ }
+
+ ensure_stock_image_widget();
+
+ gboolean sensitive = strcmp(iconStateString.get(), "disabled");
+ gtk_widget_set_sensitive (gStockImageWidget, sensitive);
+
+ GdkPixbuf *icon = gtk_widget_render_icon(gStockImageWidget, stockIcon.get(),
+ icon_size, NULL);
+ if (!icon) {
+ ensure_icon_factory();
+
+ GtkIconSet *icon_set = gtk_icon_set_new();
+ GtkIconSource *icon_source = gtk_icon_source_new();
+
+ gtk_icon_source_set_icon_name(icon_source, stockIcon.get());
+ gtk_icon_set_add_source(icon_set, icon_source);
+ gtk_icon_factory_add(gIconFactory, stockIcon.get(), icon_set);
+ gtk_icon_set_unref(icon_set);
+ gtk_icon_source_free(icon_source);
+
+ icon = gtk_widget_render_icon(gStockImageWidget, stockIcon.get(),
+ icon_size, NULL);
+ }
+
+ if (!icon)
+ return NS_ERROR_NOT_AVAILABLE;
+
+ nsresult rv = moz_gdk_pixbuf_to_channel(icon, getter_AddRefs(mRealChannel));
+
+ gdk_pixbuf_unref(icon);
+
+ return rv;
+}
--- modules/libpr0n/decoders/Makefile.in
+++ modules/libpr0n/decoders/Makefile.in
@@ -29,6 +29,9 @@
DIRS = $(MOZ_IMG_DECODERS)
ifneq (,$(findstring icon,$(MOZ_IMG_DECODERS)))
+#ifdef MOZ_ENABLE_GNOMEUI
+#DIRS := icon/gtk $(DIRS)
+#endif
ifeq ($(OS_ARCH),WINNT)
DIRS := icon/win $(DIRS)
endif
@@ -39,6 +42,9 @@
DIRS := icon/mac $(DIRS)
endif
endif # icon
+ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
+DIRS := icon/gtk $(DIRS)
+endif
include $(topsrcdir)/config/rules.mk
--- modules/libpref/src/init/all.js
+++ modules/libpref/src/init/all.js
@@ -49,8 +49,8 @@
pref("keyword.URL", "http://www.google.com/search?ie=UTF-8&oe=utf-8&q=");
pref("keyword.enabled", false);
-pref("general.useragent.locale", "chrome://navigator/locale/navigator.properties");
-pref("general.useragent.contentlocale", "chrome://navigator-region/locale/region.properties");
+pref("general.useragent.locale", "chrome://global/locale/intl.properties");
+pref("general.useragent.contentlocale", "chrome://browser-region/locale/region.properties");
pref("general.config.obscure_value", 13); // for MCD .cfg files
@@ -645,31 +645,30 @@
pref("converter.html2txt.structs", true); // Output structured phrases (strong, em, code, sub, sup, b, i, u)
pref("converter.html2txt.header_strategy", 1); // 0 = no indention; 1 = indention, increased with header level; 2 = numbering and slight indention
-pref("intl.accept_languages", "chrome://navigator/locale/navigator.properties");
+pref("intl.accept_languages", "chrome://global/locale/intl.properties");
pref("intl.accept_charsets", "iso-8859-1,*,utf-8");
-pref("intl.collationOption", "chrome://navigator-platform/locale/navigator.properties");
-pref("intl.menuitems.alwaysappendaccesskeys","chrome://navigator/locale/navigator.properties");
-pref("intl.charsetmenu.browser.static", "chrome://navigator/locale/navigator.properties");
-pref("intl.charsetmenu.browser.more1", "chrome://navigator/locale/navigator.properties");
-pref("intl.charsetmenu.browser.more2", "chrome://navigator/locale/navigator.properties");
-pref("intl.charsetmenu.browser.more3", "chrome://navigator/locale/navigator.properties");
-pref("intl.charsetmenu.browser.more4", "chrome://navigator/locale/navigator.properties");
-pref("intl.charsetmenu.browser.more5", "chrome://navigator/locale/navigator.properties");
-pref("intl.charsetmenu.browser.unicode", "chrome://navigator/locale/navigator.properties");
-pref("intl.charsetmenu.mailedit", "chrome://navigator/locale/navigator.properties");
+pref("intl.collationOption", "chrome://global-platform/locale/intl.properties");
+pref("intl.menuitems.alwaysappendaccesskeys","chrome://global/locale/intl.properties");
+pref("intl.charsetmenu.browser.static", "chrome://global/locale/intl.properties");
+pref("intl.charsetmenu.browser.more1", "chrome://global/locale/intl.properties");
+pref("intl.charsetmenu.browser.more2", "chrome://global/locale/intl.properties");
+pref("intl.charsetmenu.browser.more3", "chrome://global/locale/intl.properties");
+pref("intl.charsetmenu.browser.more4", "chrome://global/locale/intl.properties");
+pref("intl.charsetmenu.browser.more5", "chrome://global/locale/intl.properties");
+pref("intl.charsetmenu.browser.unicode", "chrome://global/locale/intl.properties");
+pref("intl.charsetmenu.mailedit", "chrome://global/locale/intl.properties");
pref("intl.charsetmenu.browser.cache", "");
pref("intl.charsetmenu.mailview.cache", "");
pref("intl.charsetmenu.composer.cache", "");
pref("intl.charsetmenu.browser.cache.size", 5);
-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.charset.detector", "chrome://global/locale/intl.properties");
+pref("intl.charset.default", "chrome://global-platform/locale/intl.properties");
pref("intl.locale.matchOS", false);
// 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
pref("intl.fallbackCharsetList.ISO-8859-1", "windows-1252");
-pref("font.language.group", "chrome://navigator/locale/navigator.properties");
+pref("font.language.group", "chrome://global/locale/intl.properties");
pref("images.dither", "auto");
pref("security.directory", "");
@@ -725,6 +724,16 @@
pref("mousewheel.horizscroll.withaltkey.numlines",-1);
pref("mousewheel.horizscroll.withaltkey.sysnumlines",false);
+pref("mousebuttonsextended.buttonlist", "67");
+pref("mousebuttonsextended.buttons.6.action.up", 2);
+pref("mousebuttonsextended.buttons.6.numlines.up", -1);
+pref("mousebuttonsextended.buttons.6.action.down", -1);
+pref("mousebuttonsextended.buttons.6.numlines.down", -1);
+pref("mousebuttonsextended.buttons.7.action.up", 2);
+pref("mousebuttonsextended.buttons.7.numlines.up", 1);
+pref("mousebuttonsextended.buttons.7.action.down", -1);
+pref("mousebuttonsextended.buttons.7.numlines.down", -1);
+
pref("profile.confirm_automigration",true);
// profile.migration_behavior determines how the profiles root is set
// 0 - use NS_APP_USER_PROFILES_ROOT_DIR
--- toolkit/components/filepicker/content/filepicker.js
+++ toolkit/components/filepicker/content/filepicker.js
@@ -67,6 +67,7 @@
if (o.displayDirectory) {
const directory = o.displayDirectory.path;
}
+
const initialText = o.defaultString;
const filterTitles = o.filters.titles;
const filterTypes = o.filters.types;
@@ -121,13 +122,18 @@
treeView.showOnlyDirectories = true;
}
+ // set up the right icon for GNOME stock icons
+ if (filePickerMode == nsIFilePicker.modeSave)
+ okButton.setAttribute("icon","save");
+ else
+ okButton.setAttribute("icon","open");
+
// start out with a filename sort
handleColumnClick("FilenameColumn");
document.documentElement.setAttribute("ondialogcancel", "return onCancel();");
try {
- var buttonLabel = getOKAction();
- okButton.setAttribute("label", buttonLabel);
+ setOKAction();
} catch (exception) {
// keep it set to "OK"
}
@@ -496,8 +502,9 @@
onFileSelected(treeView.selectedFiles);
}
-function getOKAction(file) {
+function setOKAction(file) {
var buttonLabel;
+ var buttonIcon = "open"; // used in all but one case
if (file && file.isDirectory() && filePickerMode != nsIFilePicker.modeGetFolder) {
document.documentElement.setAttribute("ondialogaccept", "return openOnOK();");
@@ -515,11 +522,12 @@
break;
case nsIFilePicker.modeSave:
buttonLabel = gFilePickerBundle.getString("saveButtonLabel");
+ buttonIcon = "save";
break;
}
}
-
- return buttonLabel;
+ okButton.setAttribute("label", buttonLabel);
+ okButton.setAttribute("icon", buttonIcon);
}
function onSelect(event) {
@@ -558,8 +566,7 @@
}
if (validFileSelected) {
- var buttonLabel = getOKAction(file);
- okButton.setAttribute("label", buttonLabel);
+ setOKAction(file);
okButton.disabled = invalidSelection;
} else
okButton.disabled = (textInput.value == "");
@@ -586,8 +593,7 @@
}
function onTextFieldFocus() {
- var buttonLabel = getOKAction(null);
- okButton.setAttribute("label", buttonLabel);
+ setOKAction(null);
doEnabling();
}
--- toolkit/components/filepicker/content/filepicker.xul
+++ toolkit/components/filepicker/content/filepicker.xul
@@ -95,7 +95,7 @@
-
-
+
+
--- toolkit/components/passwordmgr/resources/content/passwordManager.xul
+++ toolkit/components/passwordmgr/resources/content/passwordManager.xul
@@ -29,6 +29,7 @@
title="&windowtitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
buttons="accept"
+ buttoniconaccept="close"
onload="Startup()"
onunload="Shutdown()"
persist="screenX screenY width height">
@@ -66,9 +67,9 @@
-
-
@@ -91,9 +92,9 @@
-
-
--- toolkit/components/printing/content/printPreviewBindings.xml
+++ toolkit/components/printing/content/printPreviewBindings.xml
@@ -53,7 +53,7 @@
+ oncommand="PrintUtils.print();" icon="print"/>
@@ -118,7 +118,7 @@
+ oncommand="PrintUtils.exitPrintPreview();" icon="close"/>
--- toolkit/components/printing/content/printProgress.xul
+++ toolkit/components/printing/content/printProgress.xul
@@ -94,7 +94,7 @@
-
--- toolkit/components/printing/content/printdialog.xul
+++ toolkit/components/printing/content/printdialog.xul
@@ -48,6 +48,7 @@
onload="onLoad();"
ondialogaccept="return onAccept();"
oncancel="return onCancel();"
+ buttoniconaccept="print"
title="&printDialog.title;"
persist="screenX screenY"
screenX="24" screenY="24">
@@ -82,14 +83,14 @@
-
+
-
+
--- toolkit/content/widgets/browser.xml
+++ toolkit/content/widgets/browser.xml
@@ -577,6 +577,7 @@
this.securityUI = null;
this._fastFind = null;
+ this._webBrowserFind = null;
this.removeEventListener("load", this.onLoad, true);
this.removeEventListener("unload", this.onUnload, true);
--- toolkit/content/widgets/dialog.xml
+++ toolkit/content/widgets/dialog.xml
@@ -221,6 +221,30 @@
button.setAttribute("accesskey", accessKey);
}
}
+ // allow specifying alternate icons in the dialog header
+ if (!button.hasAttribute("icon")) {
+ // if there's an icon specified, use that
+ if (this.hasAttribute("buttonicon"+dlgtype))
+ button.setAttribute("icon", this.getAttribute("buttonicon"+dlgtype));
+ // otherwise set defaults
+ else
+ switch (dlgtype) {
+ case "accept":
+ button.setAttribute("icon","accept");
+ break;
+ case "cancel":
+ button.setAttribute("icon","cancel");
+ break;
+ case "disclosue":
+ button.setAttribute("icon","properties");
+ break;
+ case "help":
+ button.setAttribute("icon","help");
+ break;
+ default:
+ break;
+ }
+ }
}
// ensure that hitting enter triggers ondialogaccept
--- toolkit/content/widgets/expander.xml
+++ toolkit/content/widgets/expander.xml
@@ -12,7 +12,7 @@
-
+
--- toolkit/content/widgets/tabbrowser.xml
+++ toolkit/content/widgets/tabbrowser.xml
@@ -1144,7 +1144,15 @@
// clean up the before/afterselected attributes before removing the tab
oldTab.selected = false;
- // XXX browser's destructor isn't always called, so we force a cleanup ourselves
+ // Because of the way XBL works (fields just set JS
+ // properties on the element) and the code we have in place
+ // to preserve the JS objects for any elements that have
+ // JS properties set on them, the browser element won't be
+ // destroyed until the document goes away.
+ // This has to hapen before we remove the child so that the
+ // XBL implementation of nsIObserver still works. But
+ // clearing focusedWindow happens below because it gets
+ // reset by updateCurrentBrowser.
oldBrowser.destroy();
this.mTabContainer.removeChild(oldTab);
@@ -1154,6 +1162,10 @@
this.mPanelContainer.selectedIndex = newIndex;
this.updateCurrentBrowser();
+
+ // see comment above destroy above
+ oldBrowser.focusedWindow = null;
+ oldBrowser.focusedElement = null;
}
]]>