233461 Add an icon channel for gnome icon themes

Patch by marco@gnome.org r=cbiesinger sr=bryner
This commit is contained in:
marco%gnome.org 2005-01-19 11:27:21 +00:00
parent 08d46d96f1
commit de336606f1
8 changed files with 549 additions and 190 deletions

229
configure vendored
View File

@ -13047,7 +13047,12 @@ echo "configure:13015: checking MOZ_GNOMEUI_LIBS" >&5
fi
if test "$MOZ_ENABLE_GNOMEUI"; then
cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_GNOMEUI 1
EOF
fi
fi
@ -13455,7 +13460,7 @@ if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then
# Extract the first word of "javac", so it can be a program name with args.
set dummy javac; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:13459: checking for $ac_word" >&5
echo "configure:13464: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_JAVAC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -13491,7 +13496,7 @@ fi
# Extract the first word of "jar", so it can be a program name with args.
set dummy jar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:13495: checking for $ac_word" >&5
echo "configure:13500: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_JAR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -13531,7 +13536,7 @@ fi
# Extract the first word of "javac", so it can be a program name with args.
set dummy javac; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:13535: checking for $ac_word" >&5
echo "configure:13540: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_JAVAC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -13567,7 +13572,7 @@ fi
# Extract the first word of "jar", so it can be a program name with args.
set dummy jar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:13571: checking for $ac_word" >&5
echo "configure:13576: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_JAR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -13634,17 +13639,17 @@ fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:13638: checking for $ac_hdr" >&5
echo "configure:13643: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 13643 "configure"
#line 13648 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:13648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:13653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -13675,17 +13680,17 @@ done
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:13679: checking for $ac_hdr" >&5
echo "configure:13684: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 13684 "configure"
#line 13689 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:13689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:13694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -13715,7 +13720,7 @@ done
CPPFLAGS="$_SAVE_CPPFLAGS $GSSAPI_INCLUDES"
echo $ac_n "checking for gss_init_sec_context in -lgss""... $ac_c" 1>&6
echo "configure:13719: checking for gss_init_sec_context in -lgss" >&5
echo "configure:13724: checking for gss_init_sec_context in -lgss" >&5
ac_lib_var=`echo gss'_'gss_init_sec_context | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -13723,7 +13728,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgss $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13727 "configure"
#line 13732 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -13734,7 +13739,7 @@ int main() {
gss_init_sec_context()
; return 0; }
EOF
if { (eval echo configure:13738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:13743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -13759,12 +13764,12 @@ fi
_GSS_LIBS="-L$GSSAPI_DIR/lib -lgssapi_krb5"
LIBS="$LIBS $_GSS_LIBS"
echo $ac_n "checking for gss_init_sec_context""... $ac_c" 1>&6
echo "configure:13763: checking for gss_init_sec_context" >&5
echo "configure:13768: checking for gss_init_sec_context" >&5
if eval "test \"`echo '$''{'ac_cv_func_gss_init_sec_context'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 13768 "configure"
#line 13773 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gss_init_sec_context(); below. */
@ -13787,7 +13792,7 @@ gss_init_sec_context();
; return 0; }
EOF
if { (eval echo configure:13791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:13796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gss_init_sec_context=yes"
else
@ -13817,7 +13822,7 @@ fi
LIBS="$LIBS $TMP_GSSAPI_LIBS"
echo $ac_n "checking for gss_init_sec_context in -lgssapi""... $ac_c" 1>&6
echo "configure:13821: checking for gss_init_sec_context in -lgssapi" >&5
echo "configure:13826: checking for gss_init_sec_context in -lgssapi" >&5
ac_lib_var=`echo gssapi'_'gss_init_sec_context | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -13825,7 +13830,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgssapi $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13829 "configure"
#line 13834 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -13836,7 +13841,7 @@ int main() {
gss_init_sec_context()
; return 0; }
EOF
if { (eval echo configure:13840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:13845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -13872,17 +13877,17 @@ fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:13876: checking for $ac_hdr" >&5
echo "configure:13881: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 13881 "configure"
#line 13886 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:13886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:13891: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -13912,17 +13917,17 @@ done
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:13916: checking for $ac_hdr" >&5
echo "configure:13921: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 13921 "configure"
#line 13926 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:13926: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:13931: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -13950,7 +13955,7 @@ done
cat > conftest.$ac_ext <<EOF
#line 13954 "configure"
#line 13959 "configure"
#include "confdefs.h"
#if defined(HAVE_GSSAPI_H)
#include <gssapi.h>
@ -13961,7 +13966,7 @@ int main() {
gss_OID oid = GSS_C_NT_HOSTBASED_SERVICE;
; return 0; }
EOF
if { (eval echo configure:13965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:13970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_GSS_C_NT_HOSTBASED_SERVICE 1
@ -14098,7 +14103,7 @@ fi
if test -n "$MOZ_SVG_RENDERER_GDIPLUS"; then
echo $ac_n "checking for Gdiplus.h""... $ac_c" 1>&6
echo "configure:14102: checking for Gdiplus.h" >&5
echo "configure:14107: checking for Gdiplus.h" >&5
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@ -14108,7 +14113,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross
cat > conftest.$ac_ext <<EOF
#line 14112 "configure"
#line 14117 "configure"
#include "confdefs.h"
#include <windows.h>
#include <unknwn.h>
@ -14117,7 +14122,7 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:14121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:14126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
echo "$ac_t""yes" 1>&6
else
@ -14442,18 +14447,18 @@ fi
if test -n "$MOZ_OPTIMIZE"; then
echo $ac_n "checking for valid optimization flags""... $ac_c" 1>&6
echo "configure:14446: checking for valid optimization flags" >&5
echo "configure:14451: checking for valid optimization flags" >&5
_SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
cat > conftest.$ac_ext <<EOF
#line 14450 "configure"
#line 14455 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello World\n");
; return 0; }
EOF
if { (eval echo configure:14457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:14462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
_results=yes
else
@ -14671,7 +14676,7 @@ fi
if test -n "$_ENABLE_EFENCE"; then
echo $ac_n "checking for malloc in -lefence""... $ac_c" 1>&6
echo "configure:14675: checking for malloc in -lefence" >&5
echo "configure:14680: checking for malloc in -lefence" >&5
ac_lib_var=`echo efence'_'malloc | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -14679,7 +14684,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lefence $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14683 "configure"
#line 14688 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -14690,7 +14695,7 @@ int main() {
malloc()
; return 0; }
EOF
if { (eval echo configure:14694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:14699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -14790,12 +14795,12 @@ cross_compiling=$ac_cv_prog_cxx_cross
for ac_func in __builtin_vec_new __builtin_vec_delete __builtin_new __builtin_delete __pure_virtual
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:14794: checking for $ac_func" >&5
echo "configure:14799: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 14799 "configure"
#line 14804 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -14821,7 +14826,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:14825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:14830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -15065,12 +15070,12 @@ cross_compiling=$ac_cv_prog_cxx_cross
for ac_func in __cxa_demangle
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:15069: checking for $ac_func" >&5
echo "configure:15074: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 15074 "configure"
#line 15079 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -15096,7 +15101,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:15100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:15105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -15234,7 +15239,7 @@ if test -z "$SKIP_COMPILER_CHECKS"; then
# Compiler Options
echo $ac_n "checking for gcc -pipe support""... $ac_c" 1>&6
echo "configure:15238: checking for gcc -pipe support" >&5
echo "configure:15243: checking for gcc -pipe support" >&5
if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
echo '#include <stdio.h>' > dummy-hello.c
echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
@ -15249,14 +15254,14 @@ if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
_SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -pipe"
cat > conftest.$ac_ext <<EOF
#line 15253 "configure"
#line 15258 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello World\n");
; return 0; }
EOF
if { (eval echo configure:15260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:15265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
_res_gcc_pipe="yes"
else
@ -15298,16 +15303,16 @@ if test "$_IGNORE_LONG_LONG_WARNINGS"; then
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long"
echo $ac_n "checking whether compiler supports -Wno-long-long""... $ac_c" 1>&6
echo "configure:15302: checking whether compiler supports -Wno-long-long" >&5
echo "configure:15307: checking whether compiler supports -Wno-long-long" >&5
cat > conftest.$ac_ext <<EOF
#line 15304 "configure"
#line 15309 "configure"
#include "confdefs.h"
int main() {
return(0);
; return 0; }
EOF
if { (eval echo configure:15311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:15316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
@ -15328,16 +15333,16 @@ _SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fprofile-generate"
echo $ac_n "checking whether C compiler supports -fprofile-generate""... $ac_c" 1>&6
echo "configure:15332: checking whether C compiler supports -fprofile-generate" >&5
echo "configure:15337: checking whether C compiler supports -fprofile-generate" >&5
cat > conftest.$ac_ext <<EOF
#line 15334 "configure"
#line 15339 "configure"
#include "confdefs.h"
int main() {
return 0;
; return 0; }
EOF
if { (eval echo configure:15341: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:15346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
PROFILE_GEN_CFLAGS="-fprofile-generate"
result="yes"
@ -15355,16 +15360,16 @@ if test $result = "yes"; then
else
CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
echo $ac_n "checking whether C compiler supports -fprofile-arcs""... $ac_c" 1>&6
echo "configure:15359: checking whether C compiler supports -fprofile-arcs" >&5
echo "configure:15364: checking whether C compiler supports -fprofile-arcs" >&5
cat > conftest.$ac_ext <<EOF
#line 15361 "configure"
#line 15366 "configure"
#include "confdefs.h"
int main() {
return 0;
; return 0; }
EOF
if { (eval echo configure:15368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:15373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
PROFILE_GEN_CFLAGS="-fprofile-arcs"
result="yes"
@ -15410,18 +15415,18 @@ if test "$_PEDANTIC"; then
_SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
echo $ac_n "checking whether C++ compiler has -pedantic long long bug""... $ac_c" 1>&6
echo "configure:15414: checking whether C++ compiler has -pedantic long long bug" >&5
echo "configure:15419: checking whether C++ compiler has -pedantic long long bug" >&5
if test "$cross_compiling" = yes; then
result="maybe"
else
cat > conftest.$ac_ext <<EOF
#line 15419 "configure"
#line 15424 "configure"
#include "confdefs.h"
int main () {
if (sizeof(long long) != 8) { return 1; }
return 0; }
EOF
if { (eval echo configure:15425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:15430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
result="no"
else
@ -15451,12 +15456,12 @@ fi
fi
echo $ac_n "checking for correct temporary object destruction order""... $ac_c" 1>&6
echo "configure:15455: checking for correct temporary object destruction order" >&5
echo "configure:15460: checking for correct temporary object destruction order" >&5
if test "$cross_compiling" = yes; then
result="maybe"
else
cat > conftest.$ac_ext <<EOF
#line 15460 "configure"
#line 15465 "configure"
#include "confdefs.h"
class A {
public: A(int& x) : mValue(x) {}
@ -15476,7 +15481,7 @@ else
}
EOF
if { (eval echo configure:15480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:15485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
result="yes"
else
@ -15497,12 +15502,12 @@ fi
_SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
echo $ac_n "checking for correct overload resolution with const and templates""... $ac_c" 1>&6
echo "configure:15501: checking for correct overload resolution with const and templates" >&5
echo "configure:15506: checking for correct overload resolution with const and templates" >&5
if eval "test \"`echo '$''{'ac_nscap_nonconst_opeq_bug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 15506 "configure"
#line 15511 "configure"
#include "confdefs.h"
template <class T>
@ -15532,7 +15537,7 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:15536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:15541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_nscap_nonconst_opeq_bug="no"
else
@ -15814,7 +15819,7 @@ then
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:15818: checking for $ac_word" >&5
echo "configure:15823: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -15858,19 +15863,19 @@ fi
PKG_CONFIG_MIN_VERSION=0.9.0
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
echo $ac_n "checking for libIDL-2.0 >= 0.8.0""... $ac_c" 1>&6
echo "configure:15862: checking for libIDL-2.0 >= 0.8.0" >&5
echo "configure:15867: checking for libIDL-2.0 >= 0.8.0" >&5
if $PKG_CONFIG --exists "libIDL-2.0 >= 0.8.0" ; then
echo "$ac_t""yes" 1>&6
succeeded=yes
echo $ac_n "checking LIBIDL_CFLAGS""... $ac_c" 1>&6
echo "configure:15869: checking LIBIDL_CFLAGS" >&5
echo "configure:15874: checking LIBIDL_CFLAGS" >&5
LIBIDL_CFLAGS=`$PKG_CONFIG --cflags "libIDL-2.0 >= 0.8.0"`
echo "$ac_t""$LIBIDL_CFLAGS" 1>&6
echo $ac_n "checking LIBIDL_LIBS""... $ac_c" 1>&6
echo "configure:15874: checking LIBIDL_LIBS" >&5
echo "configure:15879: checking LIBIDL_LIBS" >&5
## don't use --libs since that can do evil things like add
## -Wl,--export-dynamic
LIBIDL_LIBS="`$PKG_CONFIG --libs-only-L \"libIDL-2.0 >= 0.8.0\"` `$PKG_CONFIG --libs-only-l \"libIDL-2.0 >= 0.8.0\"`"
@ -15993,7 +15998,7 @@ fi
# Extract the first word of "glib-config", so it can be a program name with args.
set dummy glib-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:15997: checking for $ac_word" >&5
echo "configure:16002: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GLIB_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -16028,7 +16033,7 @@ fi
min_glib_version=1.2.0
echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6
echo "configure:16032: checking for GLIB - version >= $min_glib_version" >&5
echo "configure:16037: checking for GLIB - version >= $min_glib_version" >&5
no_glib=""
if test "$GLIB_CONFIG" = "no" ; then
no_glib=yes
@ -16051,7 +16056,7 @@ echo "configure:16032: checking for GLIB - version >= $min_glib_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
#line 16055 "configure"
#line 16060 "configure"
#include "confdefs.h"
#include <glib.h>
@ -16127,7 +16132,7 @@ main ()
}
EOF
if { (eval echo configure:16131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:16136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@ -16161,7 +16166,7 @@ fi
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
cat > conftest.$ac_ext <<EOF
#line 16165 "configure"
#line 16170 "configure"
#include "confdefs.h"
#include <glib.h>
@ -16171,7 +16176,7 @@ int main() {
return ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
; return 0; }
EOF
if { (eval echo configure:16175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:16180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
@ -16215,7 +16220,7 @@ rm -f conftest*
# Extract the first word of "libIDL-config", so it can be a program name with args.
set dummy libIDL-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16219: checking for $ac_word" >&5
echo "configure:16224: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_LIBIDL_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -16250,7 +16255,7 @@ fi
min_libIDL_version=$LIBIDL_VERSION
echo $ac_n "checking for libIDL - version >= $min_libIDL_version""... $ac_c" 1>&6
echo "configure:16254: checking for libIDL - version >= $min_libIDL_version" >&5
echo "configure:16259: checking for libIDL - version >= $min_libIDL_version" >&5
no_libIDL=""
if test "$LIBIDL_CONFIG" = "no" ; then
no_libIDL=yes
@ -16277,7 +16282,7 @@ echo "configure:16254: checking for libIDL - version >= $min_libIDL_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
#line 16281 "configure"
#line 16286 "configure"
#include "confdefs.h"
#include <stdio.h>
@ -16363,7 +16368,7 @@ main ()
}
EOF
if { (eval echo configure:16367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:16372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@ -16397,7 +16402,7 @@ fi
CFLAGS="$CFLAGS $LIBIDL_CFLAGS"
LIBS="$LIBS $LIBIDL_LIBS"
cat > conftest.$ac_ext <<EOF
#line 16401 "configure"
#line 16406 "configure"
#include "confdefs.h"
#include <stdio.h>
@ -16408,7 +16413,7 @@ int main() {
return IDL_get_libver_string ? 1 : 0;
; return 0; }
EOF
if { (eval echo configure:16412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:16417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding libIDL or finding the wrong"
@ -16448,7 +16453,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16452: checking for $ac_word" >&5
echo "configure:16457: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ORBIT_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -16527,7 +16532,7 @@ if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16531: checking for $ac_word" >&5
echo "configure:16536: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -16571,19 +16576,19 @@ fi
PKG_CONFIG_MIN_VERSION=0.9.0
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
echo $ac_n "checking for glib-2.0 >= 1.3.7""... $ac_c" 1>&6
echo "configure:16575: checking for glib-2.0 >= 1.3.7" >&5
echo "configure:16580: checking for glib-2.0 >= 1.3.7" >&5
if $PKG_CONFIG --exists "glib-2.0 >= 1.3.7" ; then
echo "$ac_t""yes" 1>&6
succeeded=yes
echo $ac_n "checking GLIB_CFLAGS""... $ac_c" 1>&6
echo "configure:16582: checking GLIB_CFLAGS" >&5
echo "configure:16587: checking GLIB_CFLAGS" >&5
GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 1.3.7"`
echo "$ac_t""$GLIB_CFLAGS" 1>&6
echo $ac_n "checking GLIB_LIBS""... $ac_c" 1>&6
echo "configure:16587: checking GLIB_LIBS" >&5
echo "configure:16592: checking GLIB_LIBS" >&5
## don't use --libs since that can do evil things like add
## -Wl,--export-dynamic
GLIB_LIBS="`$PKG_CONFIG --libs-only-L \"glib-2.0 >= 1.3.7\"` `$PKG_CONFIG --libs-only-l \"glib-2.0 >= 1.3.7\"`"
@ -16667,7 +16672,7 @@ fi
# Extract the first word of "glib-config", so it can be a program name with args.
set dummy glib-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16671: checking for $ac_word" >&5
echo "configure:16676: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GLIB_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -16702,7 +16707,7 @@ fi
min_glib_version=${GLIB_VERSION}
echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6
echo "configure:16706: checking for GLIB - version >= $min_glib_version" >&5
echo "configure:16711: checking for GLIB - version >= $min_glib_version" >&5
no_glib=""
if test "$GLIB_CONFIG" = "no" ; then
no_glib=yes
@ -16725,7 +16730,7 @@ echo "configure:16706: checking for GLIB - version >= $min_glib_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
#line 16729 "configure"
#line 16734 "configure"
#include "confdefs.h"
#include <glib.h>
@ -16801,7 +16806,7 @@ main ()
}
EOF
if { (eval echo configure:16805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:16810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@ -16835,7 +16840,7 @@ fi
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
cat > conftest.$ac_ext <<EOF
#line 16839 "configure"
#line 16844 "configure"
#include "confdefs.h"
#include <glib.h>
@ -16845,7 +16850,7 @@ int main() {
return ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
; return 0; }
EOF
if { (eval echo configure:16849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:16854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
@ -16924,19 +16929,19 @@ mk_add_options MOZ_CO_MODULE=mozilla/other-licenses/libart_lgpl" 1>&2; exit 1; }
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
echo "configure:16928: checking for working alloca.h" >&5
echo "configure:16933: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 16933 "configure"
#line 16938 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
if { (eval echo configure:16940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:16945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@ -16957,12 +16962,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
echo "configure:16961: checking for alloca" >&5
echo "configure:16966: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 16966 "configure"
#line 16971 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@ -16990,7 +16995,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
if { (eval echo configure:16994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:16999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@ -17022,12 +17027,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
echo "configure:17026: checking whether alloca needs Cray hooks" >&5
echo "configure:17031: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 17031 "configure"
#line 17036 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@ -17052,12 +17057,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:17056: checking for $ac_func" >&5
echo "configure:17061: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 17061 "configure"
#line 17066 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -17080,7 +17085,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:17084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:17089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -17107,7 +17112,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
echo "configure:17111: checking stack direction for C alloca" >&5
echo "configure:17116: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -17115,7 +17120,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
#line 17119 "configure"
#line 17124 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@ -17134,7 +17139,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
if { (eval echo configure:17138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:17143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@ -17171,7 +17176,7 @@ if test "$MOZ_SVG_RENDERER_CAIRO" -o "$MOZ_ENABLE_CAIRO" ; then
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:17175: checking for $ac_word" >&5
echo "configure:17180: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -17215,19 +17220,19 @@ fi
PKG_CONFIG_MIN_VERSION=0.9.0
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
echo $ac_n "checking for cairo >= $CAIRO_VERSION""... $ac_c" 1>&6
echo "configure:17219: checking for cairo >= $CAIRO_VERSION" >&5
echo "configure:17224: checking for cairo >= $CAIRO_VERSION" >&5
if $PKG_CONFIG --exists "cairo >= $CAIRO_VERSION" ; then
echo "$ac_t""yes" 1>&6
succeeded=yes
echo $ac_n "checking CAIRO_CFLAGS""... $ac_c" 1>&6
echo "configure:17226: checking CAIRO_CFLAGS" >&5
echo "configure:17231: checking CAIRO_CFLAGS" >&5
CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo >= $CAIRO_VERSION"`
echo "$ac_t""$CAIRO_CFLAGS" 1>&6
echo $ac_n "checking CAIRO_LIBS""... $ac_c" 1>&6
echo "configure:17231: checking CAIRO_LIBS" >&5
echo "configure:17236: checking CAIRO_LIBS" >&5
## don't use --libs since that can do evil things like add
## -Wl,--export-dynamic
CAIRO_LIBS="`$PKG_CONFIG --libs-only-L \"cairo >= $CAIRO_VERSION\"` `$PKG_CONFIG --libs-only-l \"cairo >= $CAIRO_VERSION\"`"
@ -17460,14 +17465,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
#line 17464 "configure"
#line 17469 "configure"
#include "confdefs.h"
#include <gmodule.h>
int main() {
int x = 1; x++;
; return 0; }
EOF
if { (eval echo configure:17471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:17476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
:
else
echo "configure: failed program was:" >&5
@ -17751,7 +17756,7 @@ if test -n "$MOZ_X11"; then
_SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $XCFLAGS"
cat > conftest.$ac_ext <<EOF
#line 17755 "configure"
#line 17760 "configure"
#include "confdefs.h"
#include <stdio.h>
@ -17767,7 +17772,7 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:17771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:17776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
:
else
echo "configure: failed program was:" >&5

View File

@ -3882,7 +3882,9 @@ then
])
fi
if test "$MOZ_ENABLE_GNOMEUI"; then
AC_DEFINE(MOZ_ENABLE_GNOMEUI)
fi
fi
AC_SUBST(MOZ_ENABLE_GNOMEUI)
AC_SUBST(MOZ_GNOMEUI_CFLAGS)

View File

@ -49,6 +49,12 @@ extern "C" {
#include <libgnomevfs/gnome-vfs-ops.h>
}
#include <gtk/gtkwidget.h>
#include <gtk/gtkiconfactory.h>
#include <gtk/gtkimage.h>
#include <gtk/gtkwindow.h>
#include <gtk/gtkfixed.h>
#include "nsIMIMEService.h"
#include "nsIStringBundle.h"
@ -94,11 +100,87 @@ pngfile_to_channel(const char* aFilename, nsIChannel** aChannel) {
return rv;
}
nsresult
nsIconChannel::Init(nsIURI* aURI) {
mURI = do_QueryInterface(aURI);
NS_ASSERTION(mURI, "URI passed to nsIconChannel is no nsIMozIconURI!");
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_MENU;
}
nsresult
nsIconChannel::InitWithGnome()
{
nsresult rv;
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
@ -125,9 +207,21 @@ nsIconChannel::Init(nsIURI* aURI) {
gnome_init(NS_ConvertUTF16toUTF8(appName).get(), "1.0", 1, empty);
}
nsCAutoString iconSizeString;
mURI->GetIconSize(iconSizeString);
PRUint32 iconSize;
nsresult rv = mURI->GetImageSize(&iconSize);
NS_ASSERTION(NS_SUCCEEDED(rv), "GetImageSize failed");
if (iconSizeString.IsEmpty()) {
rv = mURI->GetImageSize(&iconSize);
NS_ASSERTION(NS_SUCCEEDED(rv), "GetImageSize failed");
} else {
int size;
GtkIconSize icon_size = moz_gtk_icon_size(iconSizeString.get());
gtk_icon_size_lookup(icon_size, &size, NULL);
iconSize = size;
}
nsCAutoString type;
mURI->GetContentType(type);
@ -220,27 +314,67 @@ nsIconChannel::Init(nsIURI* aURI) {
return NS_ERROR_OUT_OF_MEMORY;
}
char tmpfile[] = "/tmp/moziconXXXXXX";
int fd = mkstemp(tmpfile);
if (fd == -1) {
gdk_pixbuf_unref(scaled);
return NS_ERROR_UNEXPECTED;
}
gboolean ok = gdk_pixbuf_save(scaled, tmpfile, "png", &err, NULL);
// XXX Respect icon state
rv = moz_gdk_pixbuf_to_channel(scaled, getter_AddRefs(mRealChannel));
gdk_pixbuf_unref(scaled);
if (!ok) {
close(fd);
remove(tmpfile);
if (err)
g_error_free(err);
return NS_ERROR_UNEXPECTED;
}
rv = pngfile_to_channel(tmpfile, getter_AddRefs(mRealChannel));
close(fd);
if (NS_FAILED(rv))
remove(tmpfile);
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->GetIconSize(iconSizeString);
nsCAutoString iconStateString;
mURI->GetIconState(iconStateString);
GtkIconSize icon_size = moz_gtk_icon_size(iconSizeString.get());
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;
}
void
nsIconChannel::Shutdown() {
if (gProtoWindow)
gtk_widget_destroy(gProtoWindow);
}

View File

@ -45,7 +45,7 @@
/**
* This class is the gnome implementation of nsIconChannel. It basically asks
* gnome for the filename to a given mime type, and creates a new channel for
* 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 {
@ -54,6 +54,11 @@ class nsIconChannel : public nsIChannel {
NS_FORWARD_NSIREQUEST(mRealChannel->)
NS_FORWARD_NSICHANNEL(mRealChannel->)
nsIconChannel() {}
~nsIconChannel() {}
static void Shutdown();
/**
* Called by nsIconProtocolHandler after it creates this channel.
* Must be called before calling any other function on this object.
@ -62,8 +67,7 @@ class nsIconChannel : public nsIChannel {
NS_HIDDEN_(nsresult) Init(nsIURI* aURI);
private:
/**
* The channel to the real icon file (e.g. to
* /usr/share/icons/gnome/16x16/mimetypes/gnome-mime-application-msword.png).
* The channel to the temp icon file (e.g. to /tmp/2qy9wjqw.html).
* Will always be non-null after a successful Init.
*/
nsCOMPtr<nsIChannel> mRealChannel;
@ -71,8 +75,11 @@ class nsIconChannel : public nsIChannel {
* The moz-icon URI we're loading. Always non-null after a successful Init.
*/
nsCOMPtr<nsIMozIconURI> mURI;
/**
* Called by Init if we need to use the gnomeui library.
*/
nsresult InitWithGnome();
};
#endif

View File

@ -39,26 +39,94 @@
#include "nsIURI.idl"
//
// moz-icon URLs have the following syntax
//
// moz-icon:<file-uri>?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.
*
* What *is* a moz-icon URI you ask? Well, it has the following syntax:
*
* moz-icon://[<file-uri> | <file-with-extension> | <stock-image>]? ['?'[<parameter-value-pairs>]]
*
* <file-uri> 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.
*
* <file-with-extension> 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.
*
* <stock-image> is of the format: stock/<icon-name>
*
* <icon-name> is a valid icon name, such as 'ok', 'cancel', 'yes', 'no'.
* XXXcaa Should these considered platform dependent or can we share and document them?
*
* Legal parameter value pairs are listed below:
*
* Parameter: size
* Values: [<integer> | 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.
*
* Parameter: state
* Values: [normal | disabled]
* Description: The state of the icon.
*
* Parameter: contentType
* Values: <mime-type>
* Description: The mime type we want an icon for. This is ignored by stock images.
*/
[scriptable, uuid(733A7A16-2D36-11d5-9907-001083010E9B)]
[scriptable, uuid(1FB33F44-F522-4880-A225-4B75D09B04C6)]
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;
attribute unsigned long imageSize; // measured by # of pixels in a row. defaults to 16.
attribute ACString contentType; // may be an empty string
readonly attribute ACString fileExtension;
/**
* imageSize
*
* The image area in square pixels, defaulting to 16 if unspecified.
*/
attribute unsigned long imageSize;
/**
* stockIcon
*
* The stock icon name requested from the OS.
*/
readonly attribute ACString stockIcon;
/**
* iconSize
*
* The stock icon size requested from the OS.
*/
readonly attribute ACString iconSize;
/**
* iconState
*
* The stock icon state requested from the OS.
*/
readonly attribute ACString iconState;
/**
* 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;
};

View File

@ -44,6 +44,8 @@
#include "nsIconDecoder.h"
#endif
#include "nsIconProtocolHandler.h"
#include "nsIconURI.h"
#include "nsIconChannel.h"
// objects that just require generic constructors
/******************************************************************************
@ -72,4 +74,20 @@ static const nsModuleComponentInfo components[] =
}
};
NS_IMPL_NSGETMODULE(nsIconDecoderModule, components)
PR_STATIC_CALLBACK(nsresult)
IconDecoderModuleCtor(nsIModule* aSelf)
{
nsMozIconURI::InitAtoms();
return NS_OK;
}
PR_STATIC_CALLBACK(void)
IconDecoderModuleDtor(nsIModule* aSelf)
{
#ifdef MOZ_ENABLE_GNOMEUI
nsIconChannel::Shutdown();
#endif
}
NS_IMPL_NSGETMODULE_WITH_CTOR_DTOR(nsIconDecoderModule, components,
IconDecoderModuleCtor, IconDecoderModuleDtor)

View File

@ -44,6 +44,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
@ -52,17 +54,48 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
// 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:"
@ -82,15 +115,39 @@ nsMozIconURI::FormatSpec(nsACString &spec)
NS_ENSURE_SUCCESS(rv, rv);
spec += fileIconSpec;
}
else if (!mStockIcon.IsEmpty())
{
spec += "//stock/";
spec += mStockIcon;
}
else
{
spec += "//";
spec += mDummyFilePath;
}
spec += NS_MOZ_ICON_DELIMITER;
spec += "size=";
spec.Append(nsPrintfCString("%d", mSize));
if (mIconSize)
{
spec += NS_MOZ_ICON_DELIMITER;
spec += "size=";
const char *size_string;
mIconSize->GetUTF8String(&size_string);
spec.Append(size_string);
}
else
{
spec += NS_MOZ_ICON_DELIMITER;
spec += "size=";
spec.Append(nsPrintfCString("%d", mSize));
}
if (mIconState) {
spec += "&state=";
const char *state_string;
mIconState->GetUTF8String(&state_string);
spec.Append(state_string);
}
if (!mContentType.IsEmpty())
{
spec += "&contentType=";
@ -134,12 +191,10 @@ void extractAttributeValue(const char * searchString, const char * attributeName
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
@ -156,6 +211,8 @@ nsMozIconURI::SetSpec(const nsACString &aSpec)
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);
@ -168,43 +225,75 @@ nsMozIconURI::SetSpec(const nsACString &aSpec)
{
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())
if (!sizeString.IsEmpty())
{
nsCOMPtr<nsIAtom> atom = do_GetAtom(sizeString);
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(sSizeAtoms); i++)
{
PRInt32 sizeValue = atoi(sizeString);
// if the size value we got back is > 0 then use it
if (sizeValue)
mSize = sizeValue;
if (atom == *(sSizeAtoms[i].mAtom))
{
mIconSize = atom;
break;
}
}
}
// Okay now we have a bit of a hack here...filePath can have two forms:
if (!stateString.IsEmpty())
{
nsCOMPtr<nsIAtom> atom = do_GetAtom(stateString);
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(sStateAtoms); i++)
{
if (atom == *(sStateAtoms[i].mAtom))
{
mIconState = atom;
break;
}
}
}
// Okay now we have a bit of a hack here...filePath can have three forms:
// (1) file://<some valid platform specific file url>
// (2) //<some dummy file with an extension>
// (3) stock/<icon-identifier>
// 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 (!nsCRT::strncmp("//", mDummyFilePath.get(), 2))// must not have a url here..
if (!strncmp("//stock/", mDummyFilePath.get(), 8))
{
// in this case the string looks like //somefile.html or // somefile.extension. So throw away the "//" part
// and remember the rest in mDummyFilePath
mDummyFilePath.Cut(0, 2); // cut the first 2 bytes....
// we have a stock icon
mStockIcon = Substring(mDummyFilePath, 8);
}
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;
else
{
if (!strncmp("//", mDummyFilePath.get(), 2))// must not have a url here..
{
// in this case the string looks like //somefile.html or // somefile.extension. So throw away the "//" part
// and remember the rest in mDummyFilePath
mDummyFilePath.Cut(0, 2); // cut the first 2 bytes....
}
else if (!strncmp("file://", mDummyFilePath.get(), 7))
{
// we have a file url.....so store it...
rv = ioService->NewURI(mDummyFilePath, nsnull, nsnull, getter_AddRefs(mFileIcon));
}
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;
}
@ -454,10 +543,35 @@ nsMozIconURI::GetFileExtension(nsACString &aFileExtension)
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);
aFileExtension = nsDependentCString(fileExt);
return NS_OK;
}
NS_IMETHODIMP
nsMozIconURI::GetStockIcon(nsACString &aStockIcon)
{
aStockIcon.Assign(mStockIcon);
return NS_OK;
}
NS_IMETHODIMP
nsMozIconURI::GetIconSize(nsACString &aSize)
{
if (mIconSize)
return mIconSize->ToUTF8String(aSize);
aSize.Truncate();
return NS_OK;
}
NS_IMETHODIMP
nsMozIconURI::GetIconState(nsACString &aState)
{
if (mIconState)
return mIconState->ToUTF8String(aState);
aState.Truncate();
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -43,6 +43,9 @@
#include "nsIIconURI.h"
#include "nsCOMPtr.h"
#include "nsString.h"
class nsStaticAtom;
class nsIAtom;
#define NS_MOZICONURI_CID \
{ \
@ -59,6 +62,8 @@ public:
NS_DECL_NSIURI
NS_DECL_NSIMOZICONURI
static void InitAtoms();
// nsJARURI
nsMozIconURI();
virtual ~nsMozIconURI();
@ -68,6 +73,12 @@ protected:
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<nsIAtom> mIconSize;
nsCOMPtr<nsIAtom> mIconState;
static const nsStaticAtom sSizeAtoms[];
static const nsStaticAtom sStateAtoms[];
nsresult FormatSpec(nsACString &result);
};