Blob Blame History Raw
Index: ChangeLog
===================================================================
RCS file: /cvsroot/w3m/w3m/ChangeLog,v
retrieving revision 1.924
retrieving revision 1.946
diff -u -r1.924 -r1.946
--- ChangeLog	28 Apr 2004 18:19:22 -0000	1.924
+++ ChangeLog	26 Feb 2005 17:13:58 -0000	1.946
@@ -1,3 +1,163 @@
+2005-02-27  Fumitoshi UKAI  <ukai@debian.or.jp>
+
+	* configure.ac: rename from configure.in. this is for autoconf2.50
+
+2005-02-27  NOMIYA Masaru <nomiya@ttmy.ne.jp>
+
+	* [w3m-dev 04143] Patch for OS/2
+	* config.h.in: ifdef HAVE_SETPGRP
+	* configure.in: define USE_BINMODE_STREAM for *os2-emx*
+	* islang.c: ULONG -> unsigned long
+	* main.c: ULONG -> unsigned long
+
+2005-02-15  Fumitoshi UKAI  <ukai@debian.or.jp>
+
+	* [w3m-dev-en 01045] From newbie: problem with w3m-0.5.1 installation
+	* acinclude.m4 (AC_W3M_SSL): define USE_SSL after ssl library found
+
+2005-01-19  Kiyokazu SUTO <suto@ks-and-ks.ne.jp>
+
+	* [w3m-dev 04133] mouse_end() should preced reset_tty()?
+	* terms.c (reset_exit): mouse_end() should precede reset_tty()
+
+2005-01-05  Kiyokazu SUTO <suto@ks-and-ks.ne.jp>
+
+	* [w3m-dev 04130] [w3m-dev 04131] [w3m-dev 04132] Multiple challeges in *-Authenticate header
+	* file.c (skip_auth_token): added
+		(extract_auth_val): ',' is end of token
+		(extract_auth_param): use skip_auth_token
+		(AuthDigestCred): parse qop and calc cnonce correctly
+		(findAuthentication): use skip_auth_token
+
+2004-11-09  Fumitoshi UKAI  <ukai@debian.or.jp>
+
+	* w3mimg/fb/fb_gdkpixbuf.c (fb_image_load):
+	  fix unused variable `i'
+	* w3mimg/x11/x11_w3mimg.c (x11_load_image):
+	  ditto
+
+2004-11-09  Hiroyuki Ito <ZXB01226@nifty.com>
+
+	* [w3m-dev 04128] Re: w3mimgdisplay
+	* acinclude.m4 (AC_W3M_IMAGE): check not yes
+	* aclocal.m4, configure: regen
+	* w3mimg/fb/fb_gdkpixbuf.c (fb_image_load): 
+	   fb_image_fill in case GDK_PIXBUF_FRAME_DISPOSE
+	* w3mimg/x11/x11_w3mimg.c (get_animation_size):
+	   return n
+	  (x11_load_image): 
+	   fill in case GDK_PIXBUF_FRAME_DISPOSE
+
+2004-11-05  Hiroyuki Ito <ZXB01226@nifty.com>
+
+	* [w3m-dev 04117] Re: start attribute and value attribute on ordered lists
+	* file.c (HTMLtagproc1): allow negative value for start attr
+
+2004-10-14  Fumitoshi UKAI  <ukai@debian.or.jp>
+
+	* Bug#276246: w3m's locale parsing should at least see '@euro' modifier
+	* config.h (HAVE_LANGINFO_CODESET): added
+	* configure.in (AM_LANGINFO_CODESET): added
+	* libwc/charset.c: #include <langinfo.h>
+	       (wc_charset_to_ces): use nl_langinfo(CODESET)
+
+2004-09-30  Hiroyuki Ito <ZXB01226@nifty.com>
+
+	* [w3m-dev 04108] PIPE_BUF
+	* main.c (pipeBuf): set buf->currentURL.file to prevent
+		segfault by "PIPE_BUF cat;VIEW SOURCE;"
+
+2004-08-31  SAKAI Kiyotaka <ksakai@kso.netwk.ntt-at.co.jp>
+
+	* [w3m-dev 04104] w3mmail.cgi
+	* scripts/w3mmail.cgi.in: strip ^M
+
+2004-08-17  Hiroyuki Ito <ZXB01226@nifty.com>
+
+	* [w3m-dev 04099] Re: w3m-img gtk2
+	* w3mimg/fb/fb_gdkpixbuf.c (fb_image_load): fix resize bug
+
+2004-08-06  Hiroyuki Ito <ZXB01226@nifty.com>
+
+	* [w3m-dev 04097] Re: w3m-img gtk2
+	* w3mimg/fb/fb_gdkpixbuf.c (draw): no need bg
+		(get_animation_size): use GTimeVal
+		(fb_image_load): use GTimeVal
+				fix for animation
+	* w3mimg/x11/x11_w3mimg.c (get_animation_size): use GTimeVal
+		(x11_load_image): use GTimeVal
+				fix for animation
+
+2004-08-05  Fumitoshi UKAI  <ukai@debian.or.jp>
+
+	* [w3m-dev 04096] w3m-img gtk2
+	* acinclude.m4 (AC_W3M_IMAGE): add USE_GTK2
+		add --with-imagelib=gtk2
+	* aclocal.m4 config.guess config.sub configure: regen
+	* config.h.in: add USE_GTK2
+	* w3mimg/fb/fb_gdkpixbuf.c: support USE_GTK2
+	* w3mimg/fb/fb_img.h: add fb_image_init()
+	* w3mimg/fb/fb_imlib2.h: fb_image_init() stub
+	* w3mimg/fb/fb_w3mimg.c: call fb_image_init()
+	* w3mimg/x11/x11_w3mimg.c: support USE_GTK2
+
+2004-08-03  WATANABE Katsuyuki <knabe@sannet.ne.jp>
+
+	* [w3m-dev 04095] build fix when configure with --enable-messagel10n
+	* main.c (main): locale and textdomain initialization if ENABLE_NLS
+	* menu.c (initMenu): use _() instead of gettext()
+	* rc.c (show_params): use _() instead of gettext()
+
+2004-07-18  WATANABE Katsuyuki <knabe@sannet.ne.jp>
+
+	* [w3m-dev 04094] Re: option panel: gettextize select list
+	* rc.c (load_option_panel): don't gettext&wc_conv colorstr 
+					several times
+
+2004-07-16  WATANABE Katsuyuki <knabe@sannet.ne.jp>
+
+	* [w3m-dev 04093] bookmark charset
+	* add global variable: BookmarkCharset.
+	* main.c:adBmark(): remove condition LANG = JA.
+	* main.c: buffername encode by BookmarkCharset when add bookmark.
+	* main.c: BookmarkCharset pass to w3mbookmark.
+	* w3mbookmark.c: ditto.
+
+2004-07-16  WATANABE Katsuyuki <knabe@sannet.ne.jp>
+
+	* [w3m-dev 04092] remove __CYGWIN__ && LANG == JA
+	* remove condition LANG == JA && __CYGWIN__
+	* cygwin_mouse_btn_swapped enabled when before 1.5.x 
+
+2004-07-16  WATANABE Katsuyuki <knabe@sannet.ne.jp>
+
+	* [w3m-dev 04091] option panel: gettextize select list
+	* rc.c: gettextize option select list.
+	* rc.c: add gettextize message.
+	* po/w3m.pot: ditto.
+	* po/ja.po: ditto.
+
+2004-07-14  Fumitoshi UKAI  <ukai@debian.or.jp>
+
+	* Debian Bug#259053
+	* doc/FAQ.html, doc-jp/FAQ.html: ~/.mailcap -> ~/.w3m/mailcap
+
+2004-05-11  Fumitoshi UKAI  <ukai@debian.or.jp>
+
+	* based on [w3m-dev 04079]
+	  SAKAI Kiyotaka <ksakai@kso.netwk.ntt-at.co.jp>
+	* Makefile.in: (libwc/libwc.a): always make in libwc subdir
+		(w3mimg/w3mimg.a): always make in w3mimg subdir
+
+2004-05-03  Fumitoshi UKAI  <ukai@debian.or.jp>
+
+	* [w3m-dev-en 01007]
+	* libwc/Makefile.in (CFLAGS): need @CPPFLAGS@
+
+2004-05-03  Fumitoshi UKAI  <ukai@debian.or.jp>
+
+	* version.c.in: cvs version
+
 2004-04-29  Fumitoshi UKAI  <ukai@debian.or.jp>
 
 	* w3m 0.5.1
@@ -8483,4 +8643,4 @@
 	* release-0-2-1
 	* import w3m-0.2.1
 
-$Id: ChangeLog,v 1.924 2004/04/28 18:19:22 ukai Exp $
+$Id: ChangeLog,v 1.946 2005/02/26 17:13:58 ukai Exp $
Index: Makefile.in
===================================================================
RCS file: /cvsroot/w3m/w3m/Makefile.in,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- Makefile.in	26 Apr 2004 17:04:48 -0000	1.39
+++ Makefile.in	10 May 2004 17:45:06 -0000	1.40
@@ -182,7 +182,8 @@
 inflate.o: inflate.c
 	$(CC) $(CFLAGS) -o $@ -c $(srcdir)/inflate.c
 
-libwc/libwc.a:
+libwc/libwc.a: libwc
+libwc:
 	(cd libwc && $(MAKE) CC='$(CC0)' OPTS='$(OPTS)')
  
 dummy.o: entity.c
@@ -194,7 +195,8 @@
 w3mimgdisplay.o: w3mimgdisplay.c w3mimg/w3mimg.h
 	$(CC) $(CFLAGS) $(IMGCFLAGS) -o $@ -c $(srcdir)/w3mimgdisplay.c
 
-w3mimg/w3mimg.a:
+w3mimg/w3mimg.a: w3mimg
+w3mimg:
 	(cd w3mimg && $(MAKE) CC="$(CC0)" OPTS="$(OPTS)")
 
 po:
Index: acinclude.m4
===================================================================
RCS file: /cvsroot/w3m/w3m/acinclude.m4,v
retrieving revision 1.37
retrieving revision 1.40
diff -u -r1.37 -r1.40
--- acinclude.m4	12 Mar 2004 17:52:59 -0000	1.37
+++ acinclude.m4	14 Feb 2005 16:36:30 -0000	1.40
@@ -486,7 +486,6 @@
  [with_ssl="yes"])
 AC_MSG_RESULT($with_ssl)
 if test x"$with_ssl" != xno; then
-  AC_DEFINE(USE_SSL)
   PKG_CHECK_MODULES(SSL, openssl,,[
     AC_MSG_CHECKING(for SSL library/header)
     test x"$with_ssl" = xyes && with_ssl="/usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local"
@@ -512,6 +511,7 @@
 	[$SSL_LIBS -lcrypto])
 
   if test x"$w3m_ssl" = xfound; then
+    AC_DEFINE(USE_SSL)
     AC_MSG_CHECKING(if SSL certificate verify is enabled)
     AC_ARG_ENABLE(sslverify,
       [   --disable-sslverify		verify SSL certificate],,
@@ -573,6 +573,7 @@
  INSTALL_W3MIMGDISPLAY='${INSTALL_PROGRAM}'
  AC_DEFINE(INSTALL_W3MIMGDISPLAY, $INSTALL_W3MIMGDISPLAY)
  AC_SUBST(USE_GDKPIXBUF)
+ AC_SUBST(USE_GTK2)
  AC_SUBST(USE_IMLIB)
  AC_SUBST(USE_IMLIB2)
  AC_SUBST(IMGTARGETS)
@@ -618,16 +619,17 @@
   AC_ARG_WITH(imagelib,
    [  --with-imagelib=IMAGELIBS		image library
 				 IMAGELIBS may be space separeted list of: 
-				    gdk-pixbuf imlib imlib2],,
+				    gtk2 gdk-pixbuf imlib imlib2],,
 
    [with_imagelib="yes"])
   if test x"$with_imagelib" = xyes; then
-    with_imagelib="gdk-pixbuf imlib imlib2"
+    with_imagelib="gtk2 gdk-pixbuf imlib imlib2"
   fi
   AC_MSG_RESULT($with_imagelib)
   with_imlib=no
   with_imlib2=no
   with_gdkpixbuf=no
+  with_gtk2=no
   for imagelib in $with_imagelib
   do
    case "$imagelib" in
@@ -646,15 +648,31 @@
      if test x"$GDKPIXBUF_CONFIG" = x; then
        GDKPIXBUF_CONFIG=gdk-pixbuf-config
      fi;;
+   gtk2)
+     with_gtk2="yes"
+     if test x"$PKG_CONFIG" = x; then
+       PKG_CONFIG=pkg-config
+     else
+       PKG_CONFIG=:
+     fi;;
    esac
   done
   IMGTARGETS=""
-  if test x"$with_gdkpixbuf" = xyes; then
+  if test x"$with_gtk2" = xyes; then
    AC_W3M_CHECK_VER([GdkPixbuf],
+	[`$PKG_CONFIG --modversion gdk-pixbuf-2.0 2>/dev/null`],
+	2, 0, 0,
+	[have_gdkpixbuf="yes"; have_gtk2="yes"],
+	[have_gdkpixbuf="no"; have_gtk2="no"])
+  fi
+  if test x"$with_gdkpixbuf" = xyes; then
+   if test x"$have_gdkpixbuf" != xyes; then
+    AC_W3M_CHECK_VER([GdkPixbuf],
 	[`$GDKPIXBUF_CONFIG --version 2>/dev/null`],
 	0, 16, 0,
 	[have_gdkpixbuf="yes"],
 	[have_gdkpixbuf="no"])
+   fi
   fi
   if test x"$with_imlib" = xyes; then
    AC_W3M_CHECK_VER([Imlib],
@@ -671,46 +689,64 @@
 	[have_imlib2="no"])
   fi
   if test x"$x11" = xyes; then
-   if test x"$have_gdkpixbuf" = xyes; then
+   if test x"$have_gtk2" = xyes; then
      AC_DEFINE(USE_W3MIMG_X11)
+     IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+     IMGTARGETS="x11"    
      AC_DEFINE(USE_GDKPIXBUF)
+     AC_DEFINE(USE_GTK2)
+     IMGX11CFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
+     IMGX11LDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
+   elif test x"$have_gdkpixbuf" = xyes; then
+     AC_DEFINE(USE_W3MIMG_X11)
      IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+     IMGTARGETS="x11"    
+     AC_DEFINE(USE_GDKPIXBUF)
      IMGX11CFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
      IMGX11LDFLAGS="`${GDKPIXBUF_CONFIG} --libs` -lgdk_pixbuf_xlib"
-     IMGTARGETS="x11"    
    elif test x"$have_imlib" = xyes; then
      AC_DEFINE(USE_W3MIMG_X11)
-     AC_DEFINE(USE_IMLIB)
      IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+     IMGTARGETS="x11"    
+     AC_DEFINE(USE_IMLIB)
      IMGX11CFLAGS="`${IMLIB_CONFIG} --cflags`"
      IMGX11LDFLAGS="`${IMLIB_CONFIG} --libs`"
      IMGTARGETS="x11"    
    elif test x"$have_imlib2" = xyes; then
      AC_DEFINE(USE_W3MIMG_X11)
-     AC_DEFINE(USE_IMLIB2)
      IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+     IMGTARGETS="x11"    
+     AC_DEFINE(USE_IMLIB2)
      IMGX11CFLAGS="`${IMLIB2_CONFIG} --cflags`"
      IMGX11LDFLAGS="`${IMLIB2_CONFIG} --libs`"
-     IMGTARGETS="x11"    
    else
      AC_MSG_WARN([unable to build w3mimgdisplay with X11 support])
    fi
   fi
   if test x"$fb" = xyes; then
-   if test x"$have_gdkpixbuf" = xyes; then
+   if test x"$have_gtk2" = xyes; then
      AC_DEFINE(USE_W3MIMG_FB)
+     IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+     IMGTARGETS="${IMGTARGETS} fb"
      AC_DEFINE(USE_GDKPIXBUF)
+     AC_DEFINE(USE_GTK2)
+     IMGFBCFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gtk+-2.0`"
+     IMGFBLDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gtk+-2.0`"
+   elif test x"$have_gdkpixbuf" = xyes; then
+     AC_DEFINE(USE_W3MIMG_FB)
      IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+     IMGTARGETS="${IMGTARGETS} fb"
+     AC_DEFINE(USE_GDKPIXBUF)
      IMGFBCFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
      IMGFBLDFLAGS="`${GDKPIXBUF_CONFIG} --libs`"
-     IMGTARGETS="${IMGTARGETS} fb"
    elif test x"$have_imlib2" = xyes; then
      AC_DEFINE(USE_W3MIMG_FB)
+     IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+     IMGTARGETS="${IMGTARGETS} fb"
      AC_DEFINE(USE_IMLIB2)
      IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
      IMGFBCFLAGS="`${IMLIB2_CONFIG} --cflags`"
      IMGFBLDFLAGS="`${IMLIB2_CONFIG} --libs`"
-     IMGTARGETS="${IMGTARGETS} fb"
    else
      AC_MSG_WARN([unable to build w3mimgdisplay with FB support])
    fi
Index: aclocal.m4
===================================================================
RCS file: /cvsroot/w3m/w3m/aclocal.m4,v
retrieving revision 1.38
retrieving revision 1.41
diff -u -r1.38 -r1.41
--- aclocal.m4	12 Mar 2004 17:52:59 -0000	1.38
+++ aclocal.m4	14 Feb 2005 16:36:30 -0000	1.41
@@ -498,7 +498,6 @@
  [with_ssl="yes"])
 AC_MSG_RESULT($with_ssl)
 if test x"$with_ssl" != xno; then
-  AC_DEFINE(USE_SSL)
   PKG_CHECK_MODULES(SSL, openssl,,[
     AC_MSG_CHECKING(for SSL library/header)
     test x"$with_ssl" = xyes && with_ssl="/usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local"
@@ -524,6 +523,7 @@
 	[$SSL_LIBS -lcrypto])
 
   if test x"$w3m_ssl" = xfound; then
+    AC_DEFINE(USE_SSL)
     AC_MSG_CHECKING(if SSL certificate verify is enabled)
     AC_ARG_ENABLE(sslverify,
       [   --disable-sslverify		verify SSL certificate],,
@@ -585,6 +585,7 @@
  INSTALL_W3MIMGDISPLAY='${INSTALL_PROGRAM}'
  AC_DEFINE(INSTALL_W3MIMGDISPLAY, $INSTALL_W3MIMGDISPLAY)
  AC_SUBST(USE_GDKPIXBUF)
+ AC_SUBST(USE_GTK2)
  AC_SUBST(USE_IMLIB)
  AC_SUBST(USE_IMLIB2)
  AC_SUBST(IMGTARGETS)
@@ -630,16 +631,17 @@
   AC_ARG_WITH(imagelib,
    [  --with-imagelib=IMAGELIBS		image library
 				 IMAGELIBS may be space separeted list of: 
-				    gdk-pixbuf imlib imlib2],,
+				    gtk2 gdk-pixbuf imlib imlib2],,
 
    [with_imagelib="yes"])
   if test x"$with_imagelib" = xyes; then
-    with_imagelib="gdk-pixbuf imlib imlib2"
+    with_imagelib="gtk2 gdk-pixbuf imlib imlib2"
   fi
   AC_MSG_RESULT($with_imagelib)
   with_imlib=no
   with_imlib2=no
   with_gdkpixbuf=no
+  with_gtk2=no
   for imagelib in $with_imagelib
   do
    case "$imagelib" in
@@ -658,15 +660,31 @@
      if test x"$GDKPIXBUF_CONFIG" = x; then
        GDKPIXBUF_CONFIG=gdk-pixbuf-config
      fi;;
+   gtk2)
+     with_gtk2="yes"
+     if test x"$PKG_CONFIG" = x; then
+       PKG_CONFIG=pkg-config
+     else
+       PKG_CONFIG=:
+     fi;;
    esac
   done
   IMGTARGETS=""
-  if test x"$with_gdkpixbuf" = xyes; then
+  if test x"$with_gtk2" = xyes; then
    AC_W3M_CHECK_VER([GdkPixbuf],
+	[`$PKG_CONFIG --modversion gdk-pixbuf-2.0 2>/dev/null`],
+	2, 0, 0,
+	[have_gdkpixbuf="yes"; have_gtk2="yes"],
+	[have_gdkpixbuf="no"; have_gtk2="no"])
+  fi
+  if test x"$with_gdkpixbuf" = xyes; then
+   if test x"$have_gdkpixbuf" != xyes; then
+    AC_W3M_CHECK_VER([GdkPixbuf],
 	[`$GDKPIXBUF_CONFIG --version 2>/dev/null`],
 	0, 16, 0,
 	[have_gdkpixbuf="yes"],
 	[have_gdkpixbuf="no"])
+   fi
   fi
   if test x"$with_imlib" = xyes; then
    AC_W3M_CHECK_VER([Imlib],
@@ -683,46 +701,64 @@
 	[have_imlib2="no"])
   fi
   if test x"$x11" = xyes; then
-   if test x"$have_gdkpixbuf" = xyes; then
+   if test x"$have_gtk2" = xyes; then
      AC_DEFINE(USE_W3MIMG_X11)
+     IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+     IMGTARGETS="x11"    
      AC_DEFINE(USE_GDKPIXBUF)
+     AC_DEFINE(USE_GTK2)
+     IMGX11CFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
+     IMGX11LDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
+   elif test x"$have_gdkpixbuf" = xyes; then
+     AC_DEFINE(USE_W3MIMG_X11)
      IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+     IMGTARGETS="x11"    
+     AC_DEFINE(USE_GDKPIXBUF)
      IMGX11CFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
      IMGX11LDFLAGS="`${GDKPIXBUF_CONFIG} --libs` -lgdk_pixbuf_xlib"
-     IMGTARGETS="x11"    
    elif test x"$have_imlib" = xyes; then
      AC_DEFINE(USE_W3MIMG_X11)
-     AC_DEFINE(USE_IMLIB)
      IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+     IMGTARGETS="x11"    
+     AC_DEFINE(USE_IMLIB)
      IMGX11CFLAGS="`${IMLIB_CONFIG} --cflags`"
      IMGX11LDFLAGS="`${IMLIB_CONFIG} --libs`"
      IMGTARGETS="x11"    
    elif test x"$have_imlib2" = xyes; then
      AC_DEFINE(USE_W3MIMG_X11)
-     AC_DEFINE(USE_IMLIB2)
      IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+     IMGTARGETS="x11"    
+     AC_DEFINE(USE_IMLIB2)
      IMGX11CFLAGS="`${IMLIB2_CONFIG} --cflags`"
      IMGX11LDFLAGS="`${IMLIB2_CONFIG} --libs`"
-     IMGTARGETS="x11"    
    else
      AC_MSG_WARN([unable to build w3mimgdisplay with X11 support])
    fi
   fi
   if test x"$fb" = xyes; then
-   if test x"$have_gdkpixbuf" = xyes; then
+   if test x"$have_gtk2" = xyes; then
      AC_DEFINE(USE_W3MIMG_FB)
+     IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+     IMGTARGETS="${IMGTARGETS} fb"
      AC_DEFINE(USE_GDKPIXBUF)
+     AC_DEFINE(USE_GTK2)
+     IMGFBCFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gtk+-2.0`"
+     IMGFBLDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gtk+-2.0`"
+   elif test x"$have_gdkpixbuf" = xyes; then
+     AC_DEFINE(USE_W3MIMG_FB)
      IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+     IMGTARGETS="${IMGTARGETS} fb"
+     AC_DEFINE(USE_GDKPIXBUF)
      IMGFBCFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
      IMGFBLDFLAGS="`${GDKPIXBUF_CONFIG} --libs`"
-     IMGTARGETS="${IMGTARGETS} fb"
    elif test x"$have_imlib2" = xyes; then
      AC_DEFINE(USE_W3MIMG_FB)
+     IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+     IMGTARGETS="${IMGTARGETS} fb"
      AC_DEFINE(USE_IMLIB2)
      IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
      IMGFBCFLAGS="`${IMLIB2_CONFIG} --cflags`"
      IMGFBLDFLAGS="`${IMLIB2_CONFIG} --libs`"
-     IMGTARGETS="${IMGTARGETS} fb"
    else
      AC_MSG_WARN([unable to build w3mimgdisplay with FB support])
    fi
Index: config.guess
===================================================================
RCS file: /cvsroot/w3m/w3m/config.guess,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- config.guess	9 Mar 2003 19:40:07 -0000	1.1
+++ config.guess	4 Aug 2004 17:32:27 -0000	1.2
@@ -3,7 +3,7 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
-timestamp='2003-01-10'
+timestamp='2004-03-12'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -106,6 +106,7 @@
 : ${TMPDIR=/tmp} ;
  { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
 dummy=$tmp/dummy ;
 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
@@ -196,12 +197,18 @@
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 	echo "${machine}-${os}${release}"
 	exit 0 ;;
+    amd64:OpenBSD:*:*)
+	echo x86_64-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
     amiga:OpenBSD:*:*)
 	echo m68k-unknown-openbsd${UNAME_RELEASE}
 	exit 0 ;;
     arc:OpenBSD:*:*)
 	echo mipsel-unknown-openbsd${UNAME_RELEASE}
 	exit 0 ;;
+    cats:OpenBSD:*:*)
+	echo arm-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
     hp300:OpenBSD:*:*)
 	echo m68k-unknown-openbsd${UNAME_RELEASE}
 	exit 0 ;;
@@ -220,6 +227,9 @@
     mvmeppc:OpenBSD:*:*)
 	echo powerpc-unknown-openbsd${UNAME_RELEASE}
 	exit 0 ;;
+    pegasos:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
     pmax:OpenBSD:*:*)
 	echo mipsel-unknown-openbsd${UNAME_RELEASE}
 	exit 0 ;;
@@ -235,73 +245,70 @@
     *:OpenBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
 	exit 0 ;;
-    *:MicroBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE}
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit 0 ;;
+    macppc:MirBSD:*:*)
+	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+	exit 0 ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
 	exit 0 ;;
     alpha:OSF1:*:*)
-	if test $UNAME_RELEASE = "V4.0"; then
+	case $UNAME_RELEASE in
+	*4.0)
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-	fi
+		;;
+	*5.*)
+	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE="alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE="alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE="alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE="alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE="alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE="alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE="alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE="alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE="alphaev79" ;;
+	esac
+	# A Pn.n version is a patched version.
 	# A Vn.n version is a released version.
 	# A Tn.n version is a released field test version.
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
-	eval $set_cc_for_build
-	cat <<EOF >$dummy.s
-	.data
-\$Lformat:
-	.byte 37,100,45,37,120,10,0	# "%d-%x\n"
-
-	.text
-	.globl main
-	.align 4
-	.ent main
-main:
-	.frame \$30,16,\$26,0
-	ldgp \$29,0(\$27)
-	.prologue 1
-	.long 0x47e03d80 # implver \$0
-	lda \$2,-1
-	.long 0x47e20c21 # amask \$2,\$1
-	lda \$16,\$Lformat
-	mov \$0,\$17
-	not \$1,\$18
-	jsr \$26,printf
-	ldgp \$29,0(\$26)
-	mov 0,\$16
-	jsr \$26,exit
-	.end main
-EOF
-	$CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null
-	if test "$?" = 0 ; then
-		case `$dummy` in
-			0-0)
-				UNAME_MACHINE="alpha"
-				;;
-			1-0)
-				UNAME_MACHINE="alphaev5"
-				;;
-			1-1)
-				UNAME_MACHINE="alphaev56"
-				;;
-			1-101)
-				UNAME_MACHINE="alphapca56"
-				;;
-			2-303)
-				UNAME_MACHINE="alphaev6"
-				;;
-			2-307)
-				UNAME_MACHINE="alphaev67"
-				;;
-			2-1307)
-				UNAME_MACHINE="alphaev68"
-				;;
-			3-1307)
-				UNAME_MACHINE="alphaev7"
-				;;
-		esac
-	fi
-	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit 0 ;;
+    Alpha*:OpenVMS:*:*)
+	echo alpha-hp-vms
 	exit 0 ;;
     Alpha\ *:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
@@ -324,6 +331,9 @@
     *:OS/390:*:*)
 	echo i370-ibm-openedition
 	exit 0 ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+	exit 0 ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
 	exit 0;;
@@ -341,6 +351,9 @@
     NILE*:*:*:dcosx)
 	echo pyramid-pyramid-svr4
 	exit 0 ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit 0 ;;
     DRS?6000:UNIX_SV:4.2*:7*)
 	case `/usr/bin/uname -p` in
 	    sparc) echo sparc-icl-nx7 && exit 0 ;;
@@ -413,6 +426,9 @@
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
         echo m68k-unknown-mint${UNAME_RELEASE}
         exit 0 ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit 0 ;;
     powerpc:machten:*:*)
 	echo powerpc-apple-machten${UNAME_RELEASE}
 	exit 0 ;;
@@ -748,7 +764,7 @@
 	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
     *:UNICOS/mp:*:*)
-	echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 
+	echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
@@ -756,6 +772,11 @@
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
         exit 0 ;;
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit 0 ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
 	exit 0 ;;
@@ -777,7 +798,10 @@
 	#endif
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+	# GNU/KFreeBSD systems have a "k" prefix to indicate we are using
+	# FreeBSD's kernel, but not the complete OS.
+	case ${LIBC} in gnu) kernel_only='k' ;; esac
+	echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
 	exit 0 ;;
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
@@ -788,8 +812,8 @@
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
 	exit 0 ;;
-    x86:Interix*:3*)
-	echo i586-pc-interix3
+    x86:Interix*:[34]*)
+	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
 	exit 0 ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 	echo i${UNAME_MACHINE}-pc-mks
@@ -810,17 +834,28 @@
 	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit 0 ;;
     *:GNU:*:*)
+	# the GNU system
 	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 	exit 0 ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit 0 ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit 0 ;;
     arm*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit 0 ;;
+    cris:Linux:*:*)
+	echo cris-axis-linux-gnu
+	exit 0 ;;
     ia64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit 0 ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
     m68*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit 0 ;;
@@ -896,6 +931,9 @@
     s390:Linux:*:* | s390x:Linux:*:*)
 	echo ${UNAME_MACHINE}-ibm-linux
 	exit 0 ;;
+    sh64*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
     sh*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit 0 ;;
@@ -953,6 +991,9 @@
 	LIBC=gnuaout
 	#endif
 	#endif
+	#ifdef __dietlibc__
+	LIBC=dietlibc
+	#endif
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
 	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
@@ -983,6 +1024,9 @@
     i*86:atheos:*:*)
 	echo ${UNAME_MACHINE}-unknown-atheos
 	exit 0 ;;
+	i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit 0 ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 	echo i386-unknown-lynxos${UNAME_RELEASE}
 	exit 0 ;;
@@ -1054,7 +1098,7 @@
 	exit 0 ;;
     M68*:*:R3V[567]*:*)
 	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
-    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0)
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
 	OS_REL=''
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -1169,7 +1213,7 @@
     *:QNX:*:4*)
 	echo i386-pc-qnx
 	exit 0 ;;
-    NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
+    NSR-?:NONSTOP_KERNEL:*:*)
 	echo nsr-tandem-nsk${UNAME_RELEASE}
 	exit 0 ;;
     *:NonStop-UX:*:*)
@@ -1210,6 +1254,12 @@
     *:ITS:*:*)
 	echo pdp10-unknown-its
 	exit 0 ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+	exit 0 ;;
+    *:DragonFly:*:*)
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit 0 ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
Index: config.h.in
===================================================================
RCS file: /cvsroot/w3m/w3m/config.h.in,v
retrieving revision 1.12
retrieving revision 1.16
diff -u -r1.12 -r1.16
--- config.h.in	4 Apr 2004 16:47:20 -0000	1.12
+++ config.h.in	26 Feb 2005 17:06:44 -0000	1.16
@@ -72,6 +72,7 @@
 #undef W3MIMGDISPLAY_SETUID
 #undef USE_IMLIB
 #undef USE_GDKPIXBUF
+#undef USE_GTK2
 #undef USE_IMLIB2
 #undef USE_XFACE
 #undef USE_DICT
@@ -141,14 +142,18 @@
 #undef HAVE_CHDIR
 #undef HAVE_SETPGRP
 #undef HAVE_SETLOCALE
+#undef HAVE_LANGINFO_CODESET
 
 #undef SETPGRP_VOID
+#ifdef HAVE_SETPGRP
 #ifdef SETPGRP_VOID
 #define SETPGRP() setpgrp()
 #else
 #define SETPGRP() setpgrp(0,0)
 #endif
-
+#else /* no HAVE_SETPGRP; OS/2 EMX */
+#define SETPGRP() setpgid(0, 0)
+#endif
 #undef HAVE_FLOAT_H
 #undef HAVE_SYS_SELECT_H
 
@@ -193,10 +198,8 @@
 
 #if defined( __CYGWIN__ )
 #define SUPPORT_NETBIOS_SHARE 1
-#if LANG == JA
 #define SUPPORT_WIN9X_CONSOLE_MBCS 1
 #endif
-#endif
 
 #if defined(__DJGPP__)
 #define DEFAULT_TERM	"dosansi"
Index: config.sub
===================================================================
RCS file: /cvsroot/w3m/w3m/config.sub,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- config.sub	9 Mar 2003 19:40:07 -0000	1.1
+++ config.sub	4 Aug 2004 17:32:27 -0000	1.2
@@ -3,7 +3,7 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
-timestamp='2003-01-03'
+timestamp='2004-03-12'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -118,7 +118,8 @@
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -228,14 +229,15 @@
 	| a29k \
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| am33_2.0 \
 	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
-	| clipper \
+	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
 	| fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| i370 | i860 | i960 | ia64 \
-	| ip2k \
-	| m32r | m68000 | m68k | m88k | mcore \
+	| ip2k | iq2000 \
+	| m32r | m32rle | m68000 | m68k | m88k | mcore \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
@@ -247,6 +249,7 @@
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
 	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipstx39 | mipstx39el \
@@ -257,11 +260,11 @@
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
 	| pyramid \
-	| sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+	| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
-	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
 	| strongarm \
-	| tahoe | thumb | tic80 | tron \
+	| tahoe | thumb | tic4x | tic80 | tron \
 	| v850 | v850e \
 	| we32k \
 	| x86 | xscale | xstormy16 | xtensa \
@@ -296,7 +299,7 @@
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* \
 	| bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
 	| clipper-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
@@ -304,8 +307,8 @@
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
-	| ip2k-* \
-	| m32r-* \
+	| ip2k-* | iq2000-* \
+	| m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
 	| m88110-* | m88k-* | mcore-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
@@ -319,6 +322,7 @@
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
 	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipstx39-* | mipstx39el-* \
@@ -329,11 +333,13 @@
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
 	| pyramid-* \
 	| romp-* | rs6000-* \
-	| sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
+	| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
 	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
-	| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
-	| tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tron-* \
 	| v850-* | v850e-* | vax-* \
 	| we32k-* \
 	| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
@@ -357,6 +363,9 @@
 		basic_machine=a29k-amd
 		os=-udi
 		;;
+    	abacus)
+		basic_machine=abacus-unknown
+		;;
 	adobe68k)
 		basic_machine=m68010-adobe
 		os=-scout
@@ -371,6 +380,12 @@
 		basic_machine=a29k-none
 		os=-bsd
 		;;
+	amd64)
+		basic_machine=x86_64-pc
+		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	amdahl)
 		basic_machine=580-amdahl
 		os=-sysv
@@ -430,12 +445,20 @@
 		basic_machine=j90-cray
 		os=-unicos
 		;;
+	cr16c)
+		basic_machine=cr16c-unknown
+		os=-elf
+		;;
 	crds | unos)
 		basic_machine=m68k-crds
 		;;
 	cris | cris-* | etrax*)
 		basic_machine=cris-axis
 		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
 	da30 | da30-*)
 		basic_machine=m68k-da30
 		;;
@@ -735,6 +758,10 @@
 		basic_machine=or32-unknown
 		os=-coff
 		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
+		;;
 	OSE68000 | ose68000)
 		basic_machine=m68000-ericsson
 		os=-ose
@@ -766,18 +793,24 @@
 	pentiumpro | p6 | 6x86 | athlon | athlon_*)
 		basic_machine=i686-pc
 		;;
-	pentiumii | pentium2)
+	pentiumii | pentium2 | pentiumiii | pentium3)
 		basic_machine=i686-pc
 		;;
+	pentium4)
+		basic_machine=i786-pc
+		;;
 	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
 		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	pentiumpro-* | p6-* | 6x86-* | athlon-*)
 		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
-	pentiumii-* | pentium2-*)
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
 		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
+	pentium4-*)
+		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	pn)
 		basic_machine=pn-gould
 		;;
@@ -836,6 +869,10 @@
 	sb1el)
 		basic_machine=mipsisa64sb1el-unknown
 		;;
+	sei)
+		basic_machine=mips-sei
+		os=-seiux
+		;;
 	sequent)
 		basic_machine=i386-sequent
 		;;
@@ -843,6 +880,9 @@
 		basic_machine=sh-hitachi
 		os=-hms
 		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
 	sparclite-wrs | simso-wrs)
 		basic_machine=sparclite-wrs
 		os=-vxworks
@@ -917,14 +957,18 @@
 		basic_machine=t90-cray
 		os=-unicos
 		;;
-        tic4x | c4x*)
-		basic_machine=tic4x-unknown
-		os=-coff
-		;;
 	tic54x | c54x*)
 		basic_machine=tic54x-unknown
 		os=-coff
 		;;
+	tic55x | c55x*)
+		basic_machine=tic55x-unknown
+		os=-coff
+		;;
+	tic6x | c6x*)
+		basic_machine=tic6x-unknown
+		os=-coff
+		;;
 	tx39)
 		basic_machine=mipstx39-unknown
 		;;
@@ -938,6 +982,10 @@
 	tower | tower-32)
 		basic_machine=m68k-ncr
 		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
 	udi29k)
 		basic_machine=a29k-amd
 		os=-udi
@@ -1027,13 +1075,13 @@
 	we32k)
 		basic_machine=we32k-att
 		;;
-	sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
+	sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
 		basic_machine=sh-unknown
 		;;
 	sh64)
 		basic_machine=sh64-unknown
 		;;
-	sparc | sparcv9 | sparcv9b)
+	sparc | sparcv8 | sparcv9 | sparcv9b)
 		basic_machine=sparc-sun
 		;;
 	cydra)
@@ -1106,19 +1154,20 @@
 	      | -aos* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
-	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* \
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-	      | -powermax* | -dnix* | -microbsd*)
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1142,6 +1191,9 @@
 	-mac*)
 		os=`echo $os | sed -e 's|mac|macos|'`
 		;;
+	-linux-dietlibc)
+		os=-linux-dietlibc
+		;;
 	-linux*)
 		os=`echo $os | sed -e 's|linux|linux-gnu|'`
 		;;
@@ -1154,6 +1206,9 @@
 	-opened*)
 		os=-openedition
 		;;
+        -os400*)
+		os=-os400
+		;;
 	-wince*)
 		os=-wince
 		;;
@@ -1175,6 +1230,9 @@
 	-atheos*)
 		os=-atheos
 		;;
+	-syllable*)
+		os=-syllable
+		;;
 	-386bsd)
 		os=-bsd
 		;;
@@ -1197,6 +1255,9 @@
 	-sinix*)
 		os=-sysv4
 		;;
+        -tpf*)
+		os=-tpf
+		;;
 	-triton*)
 		os=-sysv3
 		;;
@@ -1227,6 +1288,12 @@
 	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
 		os=-mint
 		;;
+	-aros*)
+		os=-aros
+		;;
+	-kaos*)
+		os=-kaos
+		;;
 	-none)
 		;;
 	*)
@@ -1258,6 +1325,9 @@
 	arm*-semi)
 		os=-aout
 		;;
+    c4x-* | tic4x-*)
+        os=-coff
+        ;;
 	# This must come before the *-dec entry.
 	pdp10-*)
 		os=-tops20
@@ -1436,9 +1506,15 @@
 			-mvs* | -opened*)
 				vendor=ibm
 				;;
+			-os400*)
+				vendor=ibm
+				;;
 			-ptx*)
 				vendor=sequent
 				;;
+			-tpf*)
+				vendor=ibm
+				;;
 			-vxsim* | -vxworks* | -windiss*)
 				vendor=wrs
 				;;
Index: configure
===================================================================
RCS file: /cvsroot/w3m/w3m/configure,v
retrieving revision 1.148
retrieving revision 1.153
diff -u -r1.148 -r1.153
--- configure	28 Apr 2004 18:19:24 -0000	1.148
+++ configure	26 Feb 2005 17:13:58 -0000	1.153
@@ -310,7 +310,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION W3M W3M_LANG AWK CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB PERL NKF MAN build build_cpu build_vendor build_os host host_cpu host_vendor host_os W3M_TARGET W3M_LIBS USE_M17N USE_UNICODE WCTARGET WCCFLAGS DISPLAY_CHARSET SYSTEM_CHARSET DOCUMENT_CHARSET POSUBST POLANG MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBICONV LTLIBICONV INTLLIBS LIBINTL LTLIBINTL POSUB INTLTARGET NLSTARGET USE_COLOR USE_ANSI_COLOR USE_BG_COLOR USE_IMAGE USE_W3MIMG_X11 USE_W3MIMG_FB W3MIMGDISPLAY_SETUID INSTALL_W3MIMGDISPLAY USE_GDKPIXBUF USE_IMLIB USE_IMLIB2 IMGTARGETS IMGOBJS IMGX11CFLAGS IMGX11LDFLAGS IMGFBCFLAGS IMGFBLDFLAGS USE_XFACE uncompface KEYMAP_FILE HELP_FILE KEYBIND USE_MENU USE_MOUSE USE_HISTORY USE_ALARM USE_COOKIE USE_DIGEST_AUTH USE_NNTP USE_GOPHER USE_DICT USE_HELP_CGI USE_EXTERNAL_URI_LOADER USE_W3MMAILER USE_MIGEMO DEF_MIGEMO_COMMAND DEF_EDITOR DEF_MAILER DEF_EXT_BROWSER INET6 HAVE_OLD_SS_FAMILY USE_SSL USE_SSL_VERIFY PKG_CONFIG SSL_CFLAGS SSL_LIBS USE_W3M USE_SYSMOUSE AUXBIN_TARGETS EGREP USE_BINMODE_STREAM HAVE_SYS_ERRLIST HAVE_SIGSETJMP RETSIGTYPE SIGNAL_RETURN HELP_DIR RC_DIR DOCDIRS CURRENT_VERSION LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION W3M W3M_LANG AWK CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB PERL NKF MAN build build_cpu build_vendor build_os host host_cpu host_vendor host_os W3M_TARGET W3M_LIBS USE_M17N USE_UNICODE WCTARGET WCCFLAGS DISPLAY_CHARSET SYSTEM_CHARSET DOCUMENT_CHARSET POSUBST POLANG MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBICONV LTLIBICONV INTLLIBS LIBINTL LTLIBINTL POSUB INTLTARGET NLSTARGET USE_COLOR USE_ANSI_COLOR USE_BG_COLOR USE_IMAGE USE_W3MIMG_X11 USE_W3MIMG_FB W3MIMGDISPLAY_SETUID INSTALL_W3MIMGDISPLAY USE_GDKPIXBUF USE_GTK2 USE_IMLIB USE_IMLIB2 IMGTARGETS IMGOBJS IMGX11CFLAGS IMGX11LDFLAGS IMGFBCFLAGS IMGFBLDFLAGS USE_XFACE uncompface KEYMAP_FILE HELP_FILE KEYBIND USE_MENU USE_MOUSE USE_HISTORY USE_ALARM USE_COOKIE USE_DIGEST_AUTH USE_NNTP USE_GOPHER USE_DICT USE_HELP_CGI USE_EXTERNAL_URI_LOADER USE_W3MMAILER USE_MIGEMO DEF_MIGEMO_COMMAND DEF_EDITOR DEF_MAILER DEF_EXT_BROWSER INET6 HAVE_OLD_SS_FAMILY USE_SSL USE_SSL_VERIFY PKG_CONFIG SSL_CFLAGS SSL_LIBS USE_W3M USE_SYSMOUSE AUXBIN_TARGETS EGREP USE_BINMODE_STREAM HAVE_SYS_ERRLIST HAVE_SIGSETJMP RETSIGTYPE SIGNAL_RETURN HELP_DIR RC_DIR DOCDIRS CURRENT_VERSION LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -888,7 +888,7 @@
   --without-libintl-prefix     don't search for libintl in includedir and libdir
   --with-imagelib=IMAGELIBS		image library
 				 IMAGELIBS may be space separeted list of:
-				    gdk-pixbuf imlib imlib2
+				    gtk2 gdk-pixbuf imlib imlib2
   --with-migemo=MIGEMO_COMMAND	migemo command
   --with-editor=EDITOR		default editor (/usr/bin/vi)
   --with-mailer=MAILER		default mailer (/usr/bin/mail)
@@ -4982,6 +4982,7 @@
 
 
 
+
  echo "$as_me:$LINENO: checking if image is enabled" >&5
 echo $ECHO_N "checking if image is enabled... $ECHO_C" >&6
  # Check whether --enable-image or --disable-image was given.
@@ -5038,13 +5039,14 @@
   with_imagelib="yes"
 fi;
   if test x"$with_imagelib" = xyes; then
-    with_imagelib="gdk-pixbuf imlib imlib2"
+    with_imagelib="gtk2 gdk-pixbuf imlib imlib2"
   fi
   echo "$as_me:$LINENO: result: $with_imagelib" >&5
 echo "${ECHO_T}$with_imagelib" >&6
   with_imlib=no
   with_imlib2=no
   with_gdkpixbuf=no
+  with_gtk2=no
   for imagelib in $with_imagelib
   do
    case "$imagelib" in
@@ -5063,11 +5065,40 @@
      if test x"$GDKPIXBUF_CONFIG" = x; then
        GDKPIXBUF_CONFIG=gdk-pixbuf-config
      fi;;
+   gtk2)
+     with_gtk2="yes"
+     if test x"$PKG_CONFIG" = x; then
+       PKG_CONFIG=pkg-config
+     else
+       PKG_CONFIG=:
+     fi;;
    esac
   done
   IMGTARGETS=""
+  if test x"$with_gtk2" = xyes; then
+   version="`$PKG_CONFIG --modversion gdk-pixbuf-2.0 2>/dev/null`"
+ if test x"$version" != x; then
+   echo "$as_me:$LINENO: checking GdkPixbuf version" >&5
+echo $ECHO_N "checking GdkPixbuf version... $ECHO_C" >&6
+   echo "$as_me:$LINENO: result: $version" >&5
+echo "${ECHO_T}$version" >&6
+   set -- `echo "$version" | sed 's/[^0-9]/ /g'`
+   if test "$1" -ne "2" -o "$2" -lt "0" || test "$2" -eq "0" -a "$3" -lt "0"; then
+     { echo "$as_me:$LINENO: WARNING: GdkPixbuf is too old. Install GdkPixbuf (version >= 2.0.0)" >&5
+echo "$as_me: WARNING: GdkPixbuf is too old. Install GdkPixbuf (version >= 2.0.0)" >&2;}
+     have_gdkpixbuf="no"; have_gtk2="no"
+   else
+     have_gdkpixbuf="yes"; have_gtk2="yes"
+   fi
+ else
+   { echo "$as_me:$LINENO: WARNING: GdkPixbuf is not installed.  Install GdkPixbuf (version >= 2.0.0)" >&5
+echo "$as_me: WARNING: GdkPixbuf is not installed.  Install GdkPixbuf (version >= 2.0.0)" >&2;}
+   have_gdkpixbuf="no"; have_gtk2="no"
+ fi
+  fi
   if test x"$with_gdkpixbuf" = xyes; then
-   version="`$GDKPIXBUF_CONFIG --version 2>/dev/null`"
+   if test x"$have_gdkpixbuf" != xyes; then
+    version="`$GDKPIXBUF_CONFIG --version 2>/dev/null`"
  if test x"$version" != x; then
    echo "$as_me:$LINENO: checking GdkPixbuf version" >&5
 echo $ECHO_N "checking GdkPixbuf version... $ECHO_C" >&6
@@ -5086,6 +5117,7 @@
 echo "$as_me: WARNING: GdkPixbuf is not installed.  Install GdkPixbuf (version >= 0.16.0)" >&2;}
    have_gdkpixbuf="no"
  fi
+   fi
   fi
   if test x"$with_imlib" = xyes; then
    version="`$IMLIB_CONFIG --version 2>/dev/null`"
@@ -5130,29 +5162,47 @@
  fi
   fi
   if test x"$x11" = xyes; then
-   if test x"$have_gdkpixbuf" = xyes; then
+   if test x"$have_gtk2" = xyes; then
      cat >>confdefs.h <<\_ACEOF
 #define USE_W3MIMG_X11 1
 _ACEOF
 
+     IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+     IMGTARGETS="x11"
      cat >>confdefs.h <<\_ACEOF
 #define USE_GDKPIXBUF 1
 _ACEOF
 
+     cat >>confdefs.h <<\_ACEOF
+#define USE_GTK2 1
+_ACEOF
+
+     IMGX11CFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
+     IMGX11LDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
+   elif test x"$have_gdkpixbuf" = xyes; then
+     cat >>confdefs.h <<\_ACEOF
+#define USE_W3MIMG_X11 1
+_ACEOF
+
      IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+     IMGTARGETS="x11"
+     cat >>confdefs.h <<\_ACEOF
+#define USE_GDKPIXBUF 1
+_ACEOF
+
      IMGX11CFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
      IMGX11LDFLAGS="`${GDKPIXBUF_CONFIG} --libs` -lgdk_pixbuf_xlib"
-     IMGTARGETS="x11"
    elif test x"$have_imlib" = xyes; then
      cat >>confdefs.h <<\_ACEOF
 #define USE_W3MIMG_X11 1
 _ACEOF
 
+     IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+     IMGTARGETS="x11"
      cat >>confdefs.h <<\_ACEOF
 #define USE_IMLIB 1
 _ACEOF
 
-     IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
      IMGX11CFLAGS="`${IMLIB_CONFIG} --cflags`"
      IMGX11LDFLAGS="`${IMLIB_CONFIG} --libs`"
      IMGTARGETS="x11"
@@ -5161,38 +5211,57 @@
 #define USE_W3MIMG_X11 1
 _ACEOF
 
+     IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+     IMGTARGETS="x11"
      cat >>confdefs.h <<\_ACEOF
 #define USE_IMLIB2 1
 _ACEOF
 
-     IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
      IMGX11CFLAGS="`${IMLIB2_CONFIG} --cflags`"
      IMGX11LDFLAGS="`${IMLIB2_CONFIG} --libs`"
-     IMGTARGETS="x11"
    else
      { echo "$as_me:$LINENO: WARNING: unable to build w3mimgdisplay with X11 support" >&5
 echo "$as_me: WARNING: unable to build w3mimgdisplay with X11 support" >&2;}
    fi
   fi
   if test x"$fb" = xyes; then
-   if test x"$have_gdkpixbuf" = xyes; then
+   if test x"$have_gtk2" = xyes; then
      cat >>confdefs.h <<\_ACEOF
 #define USE_W3MIMG_FB 1
 _ACEOF
 
+     IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+     IMGTARGETS="${IMGTARGETS} fb"
      cat >>confdefs.h <<\_ACEOF
 #define USE_GDKPIXBUF 1
 _ACEOF
 
+     cat >>confdefs.h <<\_ACEOF
+#define USE_GTK2 1
+_ACEOF
+
+     IMGFBCFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gtk+-2.0`"
+     IMGFBLDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gtk+-2.0`"
+   elif test x"$have_gdkpixbuf" = xyes; then
+     cat >>confdefs.h <<\_ACEOF
+#define USE_W3MIMG_FB 1
+_ACEOF
+
      IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+     IMGTARGETS="${IMGTARGETS} fb"
+     cat >>confdefs.h <<\_ACEOF
+#define USE_GDKPIXBUF 1
+_ACEOF
+
      IMGFBCFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
      IMGFBLDFLAGS="`${GDKPIXBUF_CONFIG} --libs`"
-     IMGTARGETS="${IMGTARGETS} fb"
    elif test x"$have_imlib2" = xyes; then
      cat >>confdefs.h <<\_ACEOF
 #define USE_W3MIMG_FB 1
 _ACEOF
 
+     IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+     IMGTARGETS="${IMGTARGETS} fb"
      cat >>confdefs.h <<\_ACEOF
 #define USE_IMLIB2 1
 _ACEOF
@@ -5200,7 +5269,6 @@
      IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
      IMGFBCFLAGS="`${IMLIB2_CONFIG} --cflags`"
      IMGFBLDFLAGS="`${IMLIB2_CONFIG} --libs`"
-     IMGTARGETS="${IMGTARGETS} fb"
    else
      { echo "$as_me:$LINENO: WARNING: unable to build w3mimgdisplay with FB support" >&5
 echo "$as_me: WARNING: unable to build w3mimgdisplay with FB support" >&2;}
@@ -5986,10 +6054,6 @@
 echo "$as_me:$LINENO: result: $with_ssl" >&5
 echo "${ECHO_T}$with_ssl" >&6
 if test x"$with_ssl" != xno; then
-  cat >>confdefs.h <<\_ACEOF
-#define USE_SSL 1
-_ACEOF
-
 
   succeeded=no
 
@@ -6177,6 +6241,10 @@
 
 
   if test x"$w3m_ssl" = xfound; then
+    cat >>confdefs.h <<\_ACEOF
+#define USE_SSL 1
+_ACEOF
+
     echo "$as_me:$LINENO: checking if SSL certificate verify is enabled" >&5
 echo $ECHO_N "checking if SSL certificate verify is enabled... $ECHO_C" >&6
     # Check whether --enable-sslverify or --disable-sslverify was given.
@@ -7362,7 +7430,7 @@
 
 
 case "$host_os" in
-  *cygwin*)
+  *cygwin*|*os2-emx*)
     cat >>confdefs.h <<\_ACEOF
 #define USE_BINMODE_STREAM 1
 _ACEOF
@@ -9939,6 +10007,69 @@
 fi
 
 
+  echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5
+echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
+if test "${am_cv_langinfo_codeset+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <langinfo.h>
+int
+main ()
+{
+char* cs = nl_langinfo(CODESET);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  am_cv_langinfo_codeset=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+am_cv_langinfo_codeset=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5
+echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
+  if test $am_cv_langinfo_codeset = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LANGINFO_CODESET 1
+_ACEOF
+
+  fi
+
+
 echo "$as_me:$LINENO: checking for sys_errlist" >&5
 echo $ECHO_N "checking for sys_errlist... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
@@ -10864,6 +10995,7 @@
 s,@W3MIMGDISPLAY_SETUID@,$W3MIMGDISPLAY_SETUID,;t t
 s,@INSTALL_W3MIMGDISPLAY@,$INSTALL_W3MIMGDISPLAY,;t t
 s,@USE_GDKPIXBUF@,$USE_GDKPIXBUF,;t t
+s,@USE_GTK2@,$USE_GTK2,;t t
 s,@USE_IMLIB@,$USE_IMLIB,;t t
 s,@USE_IMLIB2@,$USE_IMLIB2,;t t
 s,@IMGTARGETS@,$IMGTARGETS,;t t
Index: display.c
===================================================================
RCS file: /cvsroot/w3m/w3m/display.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- display.c	26 Sep 2003 17:59:51 -0000	1.68
+++ display.c	15 Jul 2004 16:32:38 -0000	1.69
@@ -1,4 +1,4 @@
-/* $Id: display.c,v 1.68 2003/09/26 17:59:51 ukai Exp $ */
+/* $Id: display.c,v 1.69 2004/07/15 16:32:38 ukai Exp $ */
 #include <signal.h>
 #include "fm.h"
 
@@ -433,11 +433,11 @@
 		scroll(n);
 	    }
 	    else if (n < 0 && n > -buf->LINES) {
-#if defined(__CYGWIN__) && LANG == JA
+#if 0 /* defined(__CYGWIN__) */
 		move(LASTLINE + n + 1, 0);
 		clrtoeolx();
 		refresh();
-#endif				/* defined(__CYGWIN__) && LANG == JA */
+#endif				/* defined(__CYGWIN__) */
 		rscroll(-n);
 	    }
 	    redrawNLine(buf, n);
Index: file.c
===================================================================
RCS file: /cvsroot/w3m/w3m/file.c,v
retrieving revision 1.235
retrieving revision 1.237
diff -u -r1.235 -r1.237
--- file.c	16 Apr 2004 18:47:19 -0000	1.235
+++ file.c	4 Jan 2005 15:51:04 -0000	1.237
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.235 2004/04/16 18:47:19 ukai Exp $ */
+/* $Id: file.c,v 1.237 2005/01/04 15:51:04 ukai Exp $ */
 #include "fm.h"
 #include <sys/types.h>
 #include "myctype.h"
@@ -972,7 +972,59 @@
 		 HRequest *hr, FormList *request);
 };
 
-#define TOKEN_PAT	"[^][()<>@,;:\\\"/?={} \t\001-\037\177]*"
+enum {
+    AUTHCHR_NUL,
+    AUTHCHR_SEP,
+    AUTHCHR_TOKEN,
+};
+
+static int
+skip_auth_token(char **pp)
+{
+    char *p;
+    int first = AUTHCHR_NUL, typ;
+
+    for (p = *pp ;; ++p) {
+	switch (*p) {
+	case '\0':
+	    goto endoftoken;
+	default:
+	    if ((unsigned char)*p > 037) {
+		typ = AUTHCHR_TOKEN;
+		break;
+	    }
+	    /* thru */
+	case '\177':
+	case '[':
+	case ']':
+	case '(':
+	case ')':
+	case '<':
+	case '>':
+	case '@':
+	case ';':
+	case ':':
+	case '\\':
+	case '"':
+	case '/':
+	case '?':
+	case '=':
+	case ' ':
+	case '\t':
+	case ',':
+	    typ = AUTHCHR_SEP;
+	    break;
+	}
+
+	if (!first)
+	    first = typ;
+	else if (first != typ)
+	    break;
+    }
+endoftoken:
+    *pp = p;
+    return first;
+}
 
 static Str
 extract_auth_val(char **q)
@@ -993,12 +1045,13 @@
 	}
 	if (!quoted) {
 	    switch (*qq) {
+	    case '[':
+	    case ']':
 	    case '(':
 	    case ')':
 	    case '<':
 	    case '>':
 	    case '@':
-	    case ',':
 	    case ';':
 	    case ':':
 	    case '\\':
@@ -1009,6 +1062,7 @@
 	    case ' ':
 	    case '\t':
 		qq++;
+	    case ',':
 		goto end_token;
 	    default:
 		if (*qq <= 037 || *qq == 0177) {
@@ -1022,11 +1076,6 @@
 	Strcat_char(val, *qq++);
     }
   end_token:
-    if (*qq != '\0') {
-	SKIP_BLANKS(qq);
-	if (*qq == ',')
-	    qq++;
-    }
     *q = (char *)qq;
     return val;
 }
@@ -1058,10 +1107,7 @@
 extract_auth_param(char *q, struct auth_param *auth)
 {
     struct auth_param *ap;
-    char *q0;
-    Regex re_token;
-
-    newRegex(TOKEN_PAT, FALSE, &re_token, NULL);
+    char *p;
 
     for (ap = auth; ap->name != NULL; ap++) {
 	ap->val = NULL;
@@ -1070,26 +1116,41 @@
     while (*q != '\0') {
 	SKIP_BLANKS(q);
 	for (ap = auth; ap->name != NULL; ap++) {
-	    if (strncasecmp(q, ap->name, strlen(ap->name)) == 0) {
-		q += strlen(ap->name);
-		SKIP_BLANKS(q);
-		if (*q != '=')
+	    size_t len;
+
+	    len = strlen(ap->name);
+	    if (strncasecmp(q, ap->name, len) == 0 &&
+		(IS_SPACE(q[len]) || q[len] == '=')) {
+		p = q + len;
+		SKIP_BLANKS(p);
+		if (*p != '=')
 		    return q;
-		q++;
+		q = p + 1;
 		ap->val = extract_auth_val(&q);
 		break;
 	    }
 	}
 	if (ap->name == NULL) {
 	    /* skip unknown param */
-	    if (RegexMatch(&re_token, q, -1, TRUE) == 0)
-		return q;
-	    MatchedPosition(&re_token, &q0, &q);
+	    int token_type;
+	    p = q;
+	    if ((token_type = skip_auth_token(&q)) == AUTHCHR_TOKEN &&
+		(IS_SPACE(*q) || *q == '=')) {
+		SKIP_BLANKS(q);
+		if (*q != '=')
+		    return p;
+		q++;
+		extract_auth_val(&q);
+	    }
+	    else
+		return p;
+	}
+	if (*q != '\0') {
 	    SKIP_BLANKS(q);
-	    if (*q != '=')
-		return q;
-	    q++;
-	    extract_auth_val(&q);
+	    if (*q == ',')
+		q++;
+	    else
+		break;
 	}
     }
     return q;
@@ -1157,6 +1218,12 @@
     return tmp;
 }
 
+enum {
+    QOP_NONE,
+    QOP_AUTH,
+    QOP_AUTH_INT,
+};
+
 static Str
 AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
 	       HRequest *hr, FormList *request)
@@ -1168,11 +1235,50 @@
 
     Str algorithm = qstr_unquote(get_auth_param(ha->param, "algorithm"));
     Str nonce = qstr_unquote(get_auth_param(ha->param, "nonce"));
-    Str cnonce = qstr_unquote(get_auth_param(ha->param, "cnonce"));
+    Str cnonce /* = qstr_unquote(get_auth_param(ha->param, "cnonce")) */;
+    /* cnonce is what client should generate. */
     Str qop = qstr_unquote(get_auth_param(ha->param, "qop"));
 
-    if (cnonce == NULL)
-	cnonce = Strnew_charp("cnonce");	/* XXX */
+    static union {
+	int r[4];
+	char s[sizeof(int) * 4];
+    } cnonce_seed;
+    int qop_i = QOP_NONE;
+
+    cnonce_seed.r[0] = rand();
+    cnonce_seed.r[1] = rand();
+    cnonce_seed.r[2] = rand();
+    MD5(cnonce_seed.s, sizeof(cnonce_seed.s), md5);
+    cnonce = digest_hex(md5);
+    cnonce_seed.r[3]++;
+
+    if (qop) {
+	char *p;
+	size_t i;
+
+	p = qop->ptr;
+	SKIP_BLANKS(p);
+
+	for (;;) {
+	    if ((i = strcspn(p, " \t,")) > 0) {
+		if (i == sizeof("auth-int") - sizeof("") && !strncasecmp(p, "auth-int", i)) {
+		    if (qop_i < QOP_AUTH_INT)
+			qop_i = QOP_AUTH_INT;
+		}
+		else if (i == sizeof("auth") - sizeof("") && !strncasecmp(p, "auth", i)) {
+		    if (qop_i < QOP_AUTH)
+			qop_i = QOP_AUTH;
+		}
+	    }
+
+	    if (p[i]) {
+		p += i + 1;
+		SKIP_BLANKS(p);
+	    }
+	    else
+		break;
+	}
+    }
 
     /* A1 = unq(username-value) ":" unq(realm-value) ":" passwd */
     tmp = Strnew_m_charp(uname->ptr, ":",
@@ -1204,28 +1310,34 @@
 
     /* A2 = Method ":" digest-uri-value */
     tmp = Strnew_m_charp(HTTPrequestMethod(hr)->ptr, ":", uri->ptr, NULL);
-    if (qop && (strcasecmp(qop->ptr, "auth-int") == 0)) {
+    if (qop_i == QOP_AUTH_INT) {
 	/*  A2 = Method ":" digest-uri-value ":" H(entity-body) */
-	Str ebody = Strnew();
 	if (request && request->body) {
-	    FILE *fp = fopen(request->body, "r");
-	    if (fp != NULL) {
-		int c;
-		while ((c = fgetc(fp)) != EOF)
-		    Strcat_char(ebody, c);
-		fclose(fp);
+	    if (request->method == FORM_METHOD_POST && request->enctype == FORM_ENCTYPE_MULTIPART) {
+		FILE *fp = fopen(request->body, "r");
+		if (fp != NULL) {
+		    Str ebody;
+		    ebody = Strfgetall(fp);
+		    MD5(ebody->ptr, strlen(ebody->ptr), md5);
+		}
+		else {
+		    MD5("", 0, md5);
+		}
+	    }
+	    else {
+		MD5(request->body, request->length, md5);
 	    }
 	}
-	MD5(ebody->ptr, strlen(ebody->ptr), md5);
-	ebody = digest_hex(md5);
-	Strcat_m_charp(tmp, ":", ebody->ptr, NULL);
+	else {
+	    MD5("", 0, md5);
+	}
+	Strcat_char(tmp, ':');
+	Strcat(tmp, digest_hex(md5));
     }
     MD5(tmp->ptr, strlen(tmp->ptr), md5);
     a2buf = digest_hex(md5);
 
-    if (qop &&
-	(strcasecmp(qop->ptr, "auth") == 0
-	 || strcasecmp(qop->ptr, "auth-int") == 0)) {
+    if (qop_i >= QOP_AUTH) {
 	/* request-digest  = <"> < KD ( H(A1),     unq(nonce-value)
 	 *                      ":" nc-value
 	 *                      ":" unq(cnonce-value)
@@ -1238,7 +1350,7 @@
 	tmp = Strnew_m_charp(a1buf->ptr, ":", qstr_unquote(nonce)->ptr,
 			     ":", nc,
 			     ":", qstr_unquote(cnonce)->ptr,
-			     ":", qstr_unquote(qop)->ptr,
+			     ":", qop_i == QOP_AUTH ? "auth" : "auth-int",
 			     ":", a2buf->ptr, NULL);
 	MD5(tmp->ptr, strlen(tmp->ptr), md5);
 	rd = digest_hex(md5);
@@ -1279,10 +1391,13 @@
     if ((s = get_auth_param(ha->param, "opaque")) != NULL)
 	Strcat_m_charp(tmp, ", opaque=", s->ptr, NULL);
 
-    if (qop) {
+    if (qop_i >= QOP_AUTH) {
 	Strcat_m_charp(tmp, ", qop=",
-		       get_auth_param(ha->param, "qop")->ptr, NULL);
+		       qop_i == QOP_AUTH ? "auth" : "auth-int",
+		       NULL);
 	/* XXX how to count? */
+	/* Since nonce is unique up to each *-Authenticate and w3m does not re-use *-Authenticate: headers,
+	   nonce-count should be always "00000001". */
 	Strcat_m_charp(tmp, ", nc=", nc, NULL);
     }
 
@@ -1344,12 +1459,9 @@
 findAuthentication(struct http_auth *hauth, Buffer *buf, char *auth_field)
 {
     struct http_auth *ha;
-    int len = strlen(auth_field);
+    int len = strlen(auth_field), slen;
     TextListItem *i;
     char *p0, *p;
-    Regex re_token;
-
-    newRegex(TOKEN_PAT, FALSE, &re_token, NULL);
 
     bzero(hauth, sizeof(struct http_auth));
     for (i = buf->document_header->first; i != NULL; i = i->next) {
@@ -1358,29 +1470,30 @@
 		SKIP_BLANKS(p);
 		p0 = p;
 		for (ha = &www_auth[0]; ha->scheme != NULL; ha++) {
-		    if (strncasecmp(p, ha->scheme, strlen(ha->scheme)) == 0) {
+		    slen = strlen(ha->scheme);
+		    if (strncasecmp(p, ha->scheme, slen) == 0) {
+			p += slen;
+			SKIP_BLANKS(p);
 			if (hauth->pri < ha->pri) {
 			    *hauth = *ha;
-			    p += strlen(ha->scheme);
-			    SKIP_BLANKS(p);
 			    p = extract_auth_param(p, hauth->param);
 			    break;
 			}
 			else {
 			    /* weak auth */
-			    p += strlen(ha->scheme);
-			    SKIP_BLANKS(p);
 			    p = extract_auth_param(p, none_auth_param);
 			}
 		    }
 		}
 		if (p0 == p) {
 		    /* all unknown auth failed */
-		    if (RegexMatch(&re_token, p0, -1, TRUE) == 0)
-			return NULL;
-		    MatchedPosition(&re_token, &p0, &p);
-		    SKIP_BLANKS(p);
-		    p = extract_auth_param(p, none_auth_param);
+		    int token_type;
+		    if ((token_type = skip_auth_token(&p)) == AUTHCHR_TOKEN && IS_SPACE(*p)) {
+			SKIP_BLANKS(p);
+			p = extract_auth_param(p, none_auth_param);
+		    }
+		    else
+			break;
 		}
 	    }
 	}
@@ -1893,6 +2006,27 @@
 	    status = HTST_NORMAL;
 	    goto load_doc;
 	}
+#ifdef AUTH_DEBUG
+	if ((p = checkHeader(t_buf, "WWW-Authenticate:")) != NULL) {
+	    /* Authentication needed */
+	    struct http_auth hauth;
+	    if (findAuthentication(&hauth, t_buf, "WWW-Authenticate:") != NULL
+		&& (realm = get_auth_param(hauth.param, "realm")) != NULL) {
+		auth_pu = &pu;
+		getAuthCookie(&hauth, "Authorization:", extra_header,
+			      auth_pu, &hr, request, &uname, &pwd);
+		if (uname == NULL) {
+		    /* abort */
+		    TRAP_OFF;
+		    goto page_loaded;
+		}
+		UFclose(&f);
+		add_auth_cookie_flag = 1;
+		status = HTST_NORMAL;
+		goto load_doc;
+	    }
+	}
+#endif /* defined(AUTH_DEBUG) */
 	t = checkContentType(t_buf);
 	if (t == NULL)
 	    t = "text/plain";
@@ -4180,7 +4314,7 @@
 	}
 	PUSH_ENV(cmd);
 	if (cmd == HTML_UL || cmd == HTML_OL) {
-	    if (parsedtag_get_value(tag, ATTR_START, &count) && count > 0) {
+	    if (parsedtag_get_value(tag, ATTR_START, &count)) {
 		envs[h_env->envc].count = count - 1;
 	    }
 	}
@@ -4239,6 +4373,8 @@
 		count = atoi(p);
 		if (count > 0)
 		    envs[h_env->envc].count = count;
+		else
+		    envs[h_env->envc].count = 0;
 	    }
 	    switch (envs[h_env->envc].env) {
 	    case HTML_UL:
@@ -4272,7 +4408,7 @@
 	    case HTML_OL:
 		if (parsedtag_get_value(tag, ATTR_TYPE, &p))
 		    envs[h_env->envc].type = (int)*p;
-		switch (envs[h_env->envc].type) {
+		switch ((envs[h_env->envc].count > 0)? envs[h_env->envc].type: '1') {
 		case 'i':
 		    num = romanNumeral(envs[h_env->envc].count);
 		    break;
Index: fm.h
===================================================================
RCS file: /cvsroot/w3m/w3m/fm.h,v
retrieving revision 1.125
retrieving revision 1.127
diff -u -r1.125 -r1.127
--- fm.h	16 Apr 2004 18:47:19 -0000	1.125
+++ fm.h	15 Jul 2004 16:44:37 -0000	1.127
@@ -1,4 +1,4 @@
-/* $Id: fm.h,v 1.125 2004/04/16 18:47:19 ukai Exp $ */
+/* $Id: fm.h,v 1.127 2004/07/15 16:44:37 ukai Exp $ */
 /* 
  * w3m: WWW wo Miru utility
  * 
@@ -759,11 +759,11 @@
  */
 
 extern int LINES, COLS;
-#if defined(__CYGWIN__) && LANG == JA
+#if defined(__CYGWIN__)
 extern int LASTLINE;
-#else				/* not defined(__CYGWIN__) || LANG != JA */
+#else				/* not defined(__CYGWIN__) */
 #define LASTLINE (LINES-1)
-#endif				/* not defined(__CYGWIN__) || LANG != JA */
+#endif				/* not defined(__CYGWIN__) */
 
 global int Tabstop init(8);
 global int IndentIncr init(4);
@@ -1009,6 +1009,7 @@
 global wc_ces DisplayCharset init(DISPLAY_CHARSET);
 global wc_ces DocumentCharset init(DOCUMENT_CHARSET);
 global wc_ces SystemCharset init(SYSTEM_CHARSET);
+global wc_ces BookmarkCharset init(SYSTEM_CHARSET);
 global char ExtHalfdump init(FALSE);
 global char FollowLocale init(TRUE);
 global char UseContentCharset init(TRUE);
Index: islang.c
===================================================================
RCS file: /cvsroot/w3m/w3m/islang.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- islang.c	24 Nov 2001 02:01:26 -0000	1.2
+++ islang.c	26 Feb 2005 17:06:44 -0000	1.3
@@ -18,7 +18,7 @@
 	return 1;
 
     if (isdigit((int)*argv[1])) {
-	ULONG CpList[8], CpSize;
+	unsigned long CpList[8], CpSize;
 	APIRET rc = DosQueryCp(sizeof(CpList), CpList, &CpSize);
 	if (rc)
 	    return rc;
Index: main.c
===================================================================
RCS file: /cvsroot/w3m/w3m/main.c,v
retrieving revision 1.242
retrieving revision 1.247
diff -u -r1.242 -r1.247
--- main.c	4 Apr 2004 16:47:20 -0000	1.242
+++ main.c	26 Feb 2005 17:06:44 -0000	1.247
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.242 2004/04/04 16:47:20 ukai Exp $ */
+/* $Id: main.c,v 1.247 2005/02/26 17:06:44 ukai Exp $ */
 #define MAINPROGRAM
 #include "fm.h"
 #include <signal.h>
@@ -384,9 +384,11 @@
 #endif
 #endif
     GC_init();
+#if ENABLE_NLS
     setlocale(LC_ALL, "");
     bindtextdomain(PACKAGE, LOCALEDIR);
     textdomain(PACKAGE);
+#endif
 
 #ifndef HAVE_SYS_ERRLIST
     prepare_sys_errlist();
@@ -452,6 +454,7 @@
 	SystemCharset = wc_guess_locale_charset(Locale, SystemCharset);
     }
     auto_detect = WcOption.auto_detect;
+    BookmarkCharset = DocumentCharset;
 #endif
 
     if (!non_null(HTTP_proxy) &&
@@ -1963,6 +1966,7 @@
 	buf->bufferprop |= (BP_INTERNAL | BP_NO_URL);
 	if (buf->type == NULL)
 	    buf->type = "text/plain";
+	buf->currentURL.file = "-";
 	pushBuffer(buf);
     }
     displayBuffer(Currentbuf, B_FORCE_REDRAW);
@@ -4110,25 +4114,20 @@
     Str tmp;
     FormList *request;
 
-    tmp = Sprintf("mode=panel&cookie=%s&bmark=%s&url=%s&title=%s",
+    tmp = Sprintf("mode=panel&cookie=%s&bmark=%s&url=%s&title=%s"
+#ifdef USE_M17N
+		    "&charset=%s"
+#endif
+		    ,
 		  (Str_form_quote(localCookie()))->ptr,
 		  (Str_form_quote(Strnew_charp(BookmarkFile)))->ptr,
 		  (Str_form_quote(parsedURL2Str(&Currentbuf->currentURL)))->
 		  ptr,
 #ifdef USE_M17N
-#if LANG == JA
-		  /* FIXME: why WC_CES_EUC_JP hardcoded? 
-		   *  backward compatibility.
-		   *  w3mbookmark takes arguments as EUC-JP only?
-		   */
 		  (Str_form_quote(wc_conv_strict(Currentbuf->buffername,
 						 InnerCharset,
-						 WC_CES_EUC_JP)))->ptr);
-#else
-		  (Str_form_quote(wc_conv_strict(Currentbuf->buffername,
-						 InnerCharset,
-						 SystemCharset)))->ptr);
-#endif
+						 BookmarkCharset)))->ptr,
+		  wc_ces_to_charset(BookmarkCharset));
 #else
 		  (Str_form_quote(Strnew_charp(Currentbuf->buffername)))->ptr);
 #endif
@@ -5323,7 +5322,7 @@
     int btn, x, y;
 
     btn = (unsigned char)getch() - 32;
-#if defined(__CYGWIN__)
+#if defined(__CYGWIN__) && CYGWIN_VERSION_DLL_MAJOR < 1005
     if (cygwin_mouse_btn_swapped) {
 	if (btn == MOUSE_BTN2_DOWN)
 	    btn = MOUSE_BTN3_DOWN;
@@ -5674,7 +5673,7 @@
 static char *
 getCodePage(void)
 {
-    ULONG CpList[8], CpSize;
+    unsigned long CpList[8], CpSize;
 
     if (!getenv("WINDOWID") && !DosQueryCp(sizeof(CpList), CpList, &CpSize))
 	return Sprintf("CP%d", *CpList)->ptr;
Index: menu.c
===================================================================
RCS file: /cvsroot/w3m/w3m/menu.c,v
retrieving revision 1.41
retrieving revision 1.43
diff -u -r1.41 -r1.43
--- menu.c	23 Mar 2004 16:44:02 -0000	1.41
+++ menu.c	2 Aug 2004 15:40:50 -0000	1.43
@@ -1,4 +1,4 @@
-/* $Id: menu.c,v 1.41 2004/03/23 16:44:02 ukai Exp $ */
+/* $Id: menu.c,v 1.43 2004/08/02 15:40:50 ukai Exp $ */
 /* 
  * w3m menu.c
  */
@@ -1183,7 +1183,7 @@
     int btn, x, y;
 
     btn = (unsigned char)getch() - 32;
-#if defined(__CYGWIN__)
+#if defined(__CYGWIN__) && CYGWIN_VERSION_DLL_MAJOR < 1005
     if (cygwin_mouse_btn_swapped) {
 	if (btn == MOUSE_BTN2_DOWN)
 	    btn = MOUSE_BTN3_DOWN;
@@ -1717,7 +1717,7 @@
 #endif
 	for (item = MainMenuItem; item->type != MENU_END; item++)
 	    item->label =
-		wc_conv(gettext(item->label), MainMenuCharset,
+		wc_conv(_(item->label), MainMenuCharset,
 			InnerCharset)->ptr;
 	MainMenuEncode = TRUE;
     }
Index: rc.c
===================================================================
RCS file: /cvsroot/w3m/w3m/rc.c,v
retrieving revision 1.96
retrieving revision 1.99
diff -u -r1.96 -r1.99
--- rc.c	22 Apr 2004 16:34:08 -0000	1.96
+++ rc.c	2 Aug 2004 15:40:50 -0000	1.99
@@ -1,4 +1,4 @@
-/* $Id: rc.c,v 1.96 2004/04/22 16:34:08 ukai Exp $ */
+/* $Id: rc.c,v 1.99 2004/08/02 15:40:50 ukai Exp $ */
 /* 
  * Initialization file etc.
  */
@@ -289,22 +289,22 @@
 
 #ifdef INET6
 static struct sel_c dnsorders[] = {
-    {N_S(DNS_ORDER_UNSPEC), "unspecified"},
-    {N_S(DNS_ORDER_INET_INET6), "inet inet6"},
-    {N_S(DNS_ORDER_INET6_INET), "inet6 inet"},
-    {N_S(DNS_ORDER_INET_ONLY), "inet only"},
-    {N_S(DNS_ORDER_INET6_ONLY), "inet6 only"},
+    {N_S(DNS_ORDER_UNSPEC), N_("unspecified")},
+    {N_S(DNS_ORDER_INET_INET6), N_("inet inet6")},
+    {N_S(DNS_ORDER_INET6_INET), N_("inet6 inet")},
+    {N_S(DNS_ORDER_INET_ONLY), N_("inet only")},
+    {N_S(DNS_ORDER_INET6_ONLY), N_("inet6 only")},
     {0, NULL, NULL}
 };
 #endif				/* INET6 */
 
 #ifdef USE_COOKIE
 static struct sel_c badcookiestr[] = {
-    {N_S(ACCEPT_BAD_COOKIE_DISCARD), "discard"},
+    {N_S(ACCEPT_BAD_COOKIE_DISCARD), N_("discard")},
 #if 0
-    {N_S(ACCEPT_BAD_COOKIE_ACCEPT), "accept"},
+    {N_S(ACCEPT_BAD_COOKIE_ACCEPT), N_("accept")},
 #endif
-    {N_S(ACCEPT_BAD_COOKIE_ASK), "ask"},
+    {N_S(ACCEPT_BAD_COOKIE_ASK), N_("ask")},
     {0, NULL, NULL}
 };
 #endif				/* USE_COOKIE */
@@ -314,9 +314,9 @@
 static wc_ces_list *document_charset_str = NULL;
 static wc_ces_list *system_charset_str = NULL;
 static struct sel_c auto_detect_str[] = {
-    {N_S(WC_OPT_DETECT_OFF), "OFF"},
-    {N_S(WC_OPT_DETECT_ISO_2022), "Only ISO 2022"},
-    {N_S(WC_OPT_DETECT_ON), "ON"},
+    {N_S(WC_OPT_DETECT_OFF), N_("OFF")},
+    {N_S(WC_OPT_DETECT_ISO_2022), N_("Only ISO 2022")},
+    {N_S(WC_OPT_DETECT_ON), N_("ON")},
     {0, NULL, NULL}
 };
 #endif
@@ -793,7 +793,7 @@
 #ifdef USE_M17N
 	if (!OptionEncode)
 	    cmt =
-		wc_conv(gettext(sections[j].name), OptionCharset,
+		wc_conv(_(sections[j].name), OptionCharset,
 			InnerCharset)->ptr;
 	else
 #endif
@@ -839,7 +839,7 @@
 	    }
 #ifdef USE_M17N
 	    if (!OptionEncode)
-		cmt = wc_conv(gettext(sections[j].params[i].comment),
+		cmt = wc_conv(_(sections[j].params[i].comment),
 			      OptionCharset, InnerCharset)->ptr;
 	    else
 #endif
@@ -1303,7 +1303,7 @@
 
     if (optionpanel_str == NULL)
 	optionpanel_str = Sprintf(optionpanel_src1, w3m_version,
-				  html_quote(localCookie()->ptr), CMT_HELPER);
+			      html_quote(localCookie()->ptr), _(CMT_HELPER));
 #if ENABLE_NLS
     OptionCharset = SystemCharset;	/* FIXME */
 #endif
@@ -1313,16 +1313,28 @@
 	    wc_Str_conv(optionpanel_str, OptionCharset, InnerCharset);
 	for (i = 0; sections[i].name != NULL; i++) {
 	    sections[i].name =
-		wc_conv(gettext(sections[i].name), OptionCharset,
+		wc_conv(_(sections[i].name), OptionCharset,
 			InnerCharset)->ptr;
-	    for (p = sections[i].params; p->name; p++)
+	    for (p = sections[i].params; p->name; p++) {
 		p->comment =
-		    wc_conv(gettext(p->comment), OptionCharset,
+		    wc_conv(_(p->comment), OptionCharset,
 			    InnerCharset)->ptr;
+		if (p->inputtype == PI_SEL_C
+#ifdef USE_COLOR
+			&& p->select != colorstr
+#endif
+			) {
+		    for (s = (struct sel_c *)p->select; s->text != NULL; s++) {
+			s->text =
+			    wc_conv(_(s->text), OptionCharset,
+				    InnerCharset)->ptr;
+		    }
+		}
+	    }
 	}
 #ifdef USE_COLOR
 	for (s = colorstr; s->text; s++)
-	    s->text = wc_conv(gettext(s->text), OptionCharset,
+	    s->text = wc_conv(_(s->text), OptionCharset,
 			      InnerCharset)->ptr;
 #endif
 	OptionEncode = TRUE;
Index: terms.c
===================================================================
RCS file: /cvsroot/w3m/w3m/terms.c,v
retrieving revision 1.51
retrieving revision 1.53
diff -u -r1.51 -r1.53
--- terms.c	8 Dec 2003 16:06:34 -0000	1.51
+++ terms.c	18 Jan 2005 16:38:01 -0000	1.53
@@ -1,4 +1,4 @@
-/* $Id: terms.c,v 1.51 2003/12/08 16:06:34 ukai Exp $ */
+/* $Id: terms.c,v 1.53 2005/01/18 16:38:01 ukai Exp $ */
 /* 
  * An original curses library for EUC-kanji by Akinori ITO,     December 1989
  * revised by Akinori ITO, January 1995
@@ -56,8 +56,11 @@
 #include <windows.h>
 #include <sys/cygwin.h>
 static int isWinConsole = 0;
+#define TERM_CYGWIN 1
+#define TERM_CYGWIN_RESERVE_IME 2
 static int isLocalConsole = 0;
-#ifdef USE_MOUSE
+
+#if CYGWIN_VERSION_DLL_MAJOR < 1005 && defined(USE_MOUSE)
 int cygwin_mouse_btn_swapped = 0;
 #endif
 
@@ -79,9 +82,6 @@
     }
     if (winVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
 	isWin95 = 1;
-	if (ttyslot() != -1) {
-	    isLocalConsole = 0;
-	}
     }
     else {
 	isWin95 = 0;
@@ -200,7 +200,7 @@
     return (hwndFound);
 }
 
-#ifdef USE_MOUSE
+#if CYGWIN_VERSION_DLL_MAJOR < 1005 && defined(USE_MOUSE)
 static unsigned long
 cygwin_version(void)
 {
@@ -223,7 +223,7 @@
     if (term == NULL)
 	term = DEFAULT_TERM;
     if (term && strncmp(term, "cygwin", 6) == 0) {
-	isWinConsole = 1;
+	isWinConsole = TERM_CYGWIN;
     }
     if (isWinConsole) {
 	hWnd = GetConsoleHwnd();
@@ -232,11 +232,17 @@
 		isLocalConsole = 1;
 	    }
 	}
+	if (strncmp(getenv("LANG"), "ja", 2) == 0) {
+	    isWinConsole = TERM_CYGWIN_RESERVE_IME;
+	}
 #ifdef SUPPORT_WIN9X_CONSOLE_MBCS
 	check_win9x();
+	if (isWin95 && ttyslot() != -1) {
+	    isLocalConsole = 0;
+	}
 #endif
     }
-#ifdef USE_MOUSE
+#if CYGWIN_VERSION_DLL_MAJOR < 1005 && defined(USE_MOUSE)
     if (cygwin_version() <= 1003015) {
 	/* cygwin DLL 1.3.15 or earler */
 	cygwin_mouse_btn_swapped = 1;
@@ -382,9 +388,10 @@
     *T_ti, *T_te, *T_nd, *T_as, *T_ae, *T_eA, *T_ac, *T_op;
 
 int LINES, COLS;
-#if defined(__CYGWIN__) && LANG == JA
+#if defined(__CYGWIN__)
 int LASTLINE;
-#endif				/* defined(__CYGWIN__) && LANG == JA */
+#endif				/* defined(__CYGWIN__) */
+
 static int max_LINES = 0, max_COLS = 0;
 static int tab_step = 8;
 static int CurLine, CurColumn;
@@ -589,11 +596,11 @@
 MySignalHandler
 reset_exit(SIGNAL_ARG)
 {
-    reset_tty();
 #ifdef USE_MOUSE
     if (mouseActive)
 	mouse_end();
 #endif				/* USE_MOUSE */
+    reset_tty();
     w3m_exit(0);
     SIGNAL_RETURN;
 }
@@ -763,9 +770,9 @@
 	COLS = MAX_COLUMN;
     if (LINES > MAX_LINE)
 	LINES = MAX_LINE;
-#if defined(__CYGWIN__) && LANG == JA
-    LASTLINE = LINES - (isWinConsole ? 2 : 1);
-#endif				/* defined(__CYGWIN__) && LANG == JA */
+#if defined(__CYGWIN__)
+    LASTLINE = LINES - (isWinConsole == TERM_CYGWIN_RESERVE_IME ? 2 : 1);
+#endif				/* defined(__CYGWIN__) */
 }
 
 void
@@ -1285,9 +1292,7 @@
 		 * (COLS-1,LINES-1).
 		 */
 #if !defined(USE_BG_COLOR) || defined(__CYGWIN__)
-#if defined(__CYGWIN__) && LANG == JA
 		if (isWinConsole)
-#endif				/* defined(__CYGWIN__) && LANG == JA */
 		    if (line == LINES - 1 && col == COLS - 1)
 			break;
 #endif				/* !defined(USE_BG_COLOR) || defined(__CYGWIN__) */
Index: terms.h
===================================================================
RCS file: /cvsroot/w3m/w3m/terms.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- terms.h	22 Sep 2003 21:02:22 -0000	1.9
+++ terms.h	15 Jul 2004 16:32:39 -0000	1.10
@@ -1,9 +1,9 @@
-/* $Id: terms.h,v 1.9 2003/09/22 21:02:22 ukai Exp $ */
+/* $Id: terms.h,v 1.10 2004/07/15 16:32:39 ukai Exp $ */
 #ifndef TERMS_H
 #define TERMS_H
 
 extern int LINES, COLS;
-#if defined(__CYGWIN__) && LANG == JA
+#if defined(__CYGWIN__)
 extern int LASTLINE;
 #endif
 
@@ -21,7 +21,7 @@
 #endif
 
 #ifdef __CYGWIN__
-#ifdef USE_MOUSE
+#if CYGWIN_VERSION_DLL_MAJOR < 1005 && defined(USE_MOUSE)
 extern int cygwin_mouse_btn_swapped;
 #endif
 #ifdef SUPPORT_WIN9X_CONSOLE_MBCS
Index: version.c.in
===================================================================
RCS file: /cvsroot/w3m/w3m/version.c.in,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- version.c.in	28 Apr 2004 18:19:25 -0000	1.44
+++ version.c.in	2 May 2004 16:40:46 -0000	1.45
@@ -1,5 +1,5 @@
-/* $Id: version.c.in,v 1.44 2004/04/28 18:19:25 ukai Exp $ */
-#define CURRENT_VERSION "w3m/0.5.1"
+/* $Id: version.c.in,v 1.45 2004/05/02 16:40:46 ukai Exp $ */
+#define CURRENT_VERSION "w3m/0.5.1+cvs"
 
 #ifndef FM_H
 char *w3m_version = CURRENT_VERSION;
Index: w3mbookmark.c
===================================================================
RCS file: /cvsroot/w3m/w3m/w3mbookmark.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- w3mbookmark.c	23 Sep 2003 18:42:25 -0000	1.10
+++ w3mbookmark.c	15 Jul 2004 16:44:37 -0000	1.11
@@ -1,4 +1,4 @@
-/* $Id: w3mbookmark.c,v 1.10 2003/09/23 18:42:25 ukai Exp $ */
+/* $Id: w3mbookmark.c,v 1.11 2004/07/15 16:44:37 ukai Exp $ */
 #include <stdlib.h>
 #include <stdio.h>
 #include "config.h"
@@ -52,18 +52,18 @@
 static char *Local_cookie = NULL;
 
 void
-print_bookmark_panel(char *bmark, char *url, char *title)
+print_bookmark_panel(char *bmark, char *url, char *title, char *charset)
 {
     Str tmp, tmp2;
     FILE *f;
     char *p;
 
-#if LANG == JA
-    /* FIXME: gettextize here */
-    printf("Content-Type: text/html; charset=EUC-JP\n\n");
-#else
-    printf("Content-Type: text/html\n\n");
-#endif
+    if (charset == NULL) {
+	printf("Content-Type: text/html\n\n");
+    }
+    else {
+	printf("Content-Type: text/html; charset=%s\n\n", charset);
+    }
     printf(bkmark_src1, html_quote(bmark), html_quote(Local_cookie));
     if ((f = fopen(bmark, "r")) != NULL) {
 	printf("<tr><td>Section:<td><select name=\"section\">\n");
@@ -188,6 +188,7 @@
     char *bmark;
     char *url;
     char *title;
+    char *charset;
     char *sent_cookie;
 
     p = getenv("REQUEST_METHOD");
@@ -224,12 +225,13 @@
     bmark = expandPath(tag_get_value(cgiarg, "bmark"));
     url = tag_get_value(cgiarg, "url");
     title = tag_get_value(cgiarg, "title");
+    charset = tag_get_value(cgiarg, "charset");
     if (bmark == NULL || url == NULL)
 	goto request_err;
     if (mode && !strcmp(mode, "panel")) {
 	if (title == NULL)
 	    title = "";
-	print_bookmark_panel(bmark, url, title);
+	print_bookmark_panel(bmark, url, title, charset);
     }
     else if (mode && !strcmp(mode, "register")) {
 	printf("Content-Type: text/plain\n");
Index: doc/FAQ.html
===================================================================
RCS file: /cvsroot/w3m/w3m/doc/FAQ.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- doc/FAQ.html	29 Oct 2002 14:32:07 -0000	1.4
+++ doc/FAQ.html	13 Jul 2004 17:17:39 -0000	1.5
@@ -239,7 +239,7 @@
 (if you are using netscape).
 <p>
 <dt><h3>How do I change the default image viewer?</h3>
-<dd>By default w3m uses xv to view images. If you want to change it into, let's say, 'display', add the following line to ~/.mailcap or /etc/mailcap.
+<dd>By default w3m uses xv to view images. If you want to change it into, let's say, 'display', add the following line to ~/.w3m/mailcap or /etc/mailcap.
 <p>
 <pre>
 image/*; display %s
Index: doc-jp/FAQ.html
===================================================================
RCS file: /cvsroot/w3m/w3m/doc-jp/FAQ.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- doc-jp/FAQ.html	13 May 2003 17:17:54 -0000	1.5
+++ doc-jp/FAQ.html	13 Jul 2004 17:17:39 -0000	1.6
@@ -199,7 +199,7 @@
 <p>
 <dt>画像のビューアを変えたいんだけど,どうするの?
 <dd>初期設定では画像を見るのに xv を使うようになっていますが,これを
-例えば display に変える場合は,~/.mailcap または /etc/mailcap に次のよ
+例えば display に変える場合は,~/.w3m/mailcap または /etc/mailcap に次のよ
 うな記述を入れます.
 <p>
 <pre>
Index: libwc/Makefile.in
===================================================================
RCS file: /cvsroot/w3m/w3m/libwc/Makefile.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- libwc/Makefile.in	26 Apr 2004 17:00:38 -0000	1.5
+++ libwc/Makefile.in	2 May 2004 16:44:08 -0000	1.6
@@ -6,7 +6,7 @@
 VPATH=$(srcdir):.
 LIBRARY = libwc.a
 CC=@CC@
-CFLAGS = $(OPTS) -I.. -I$(top_srcdir) -I$(srcdir) @CFLAGS@ @WCCFLAGS@ @DEFS@
+CFLAGS = $(OPTS) -I.. -I$(top_srcdir) -I$(srcdir) @CFLAGS@ @CPPFLAGS@ @WCCFLAGS@ @DEFS@
 AR=ar
 RANLIB=@RANLIB@
 RM=rm
Index: libwc/charset.c
===================================================================
RCS file: /cvsroot/w3m/w3m/libwc/charset.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- libwc/charset.c	22 Sep 2003 21:02:23 -0000	1.1
+++ libwc/charset.c	13 Oct 2004 16:52:51 -0000	1.2
@@ -6,6 +6,10 @@
 
 #include "wc.h"
 
+#ifdef HAVE_LANGINFO_CODESET
+#include <langinfo.h>
+#endif
+
 wc_locale WcLocale = 0;
 
 static struct {
@@ -369,6 +373,12 @@
 
     if (*p == 'C' && *(p+1) == '\0')
 	return WC_CES_US_ASCII;
+#ifdef HAVE_LANGINFO_CODESET
+    {
+	char *cs = nl_langinfo(CODESET);
+	return wc_charset_to_ces(cs);
+    }
+#endif
     for (n = 0; *p && *p != '.' && n < 5; p++) {
 	if ((unsigned char)*p > 0x20)
 	    buf[n++] = tolower(*p);
Index: po/ja.po
===================================================================
RCS file: /cvsroot/w3m/w3m/po/ja.po,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- po/ja.po	28 Apr 2004 18:19:26 -0000	1.4
+++ po/ja.po	15 Jul 2004 16:26:04 -0000	1.5
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: w3m 0.5.1\n"
 "Report-Msgid-Bugs-To: ukai@debian.or.jp\n"
-"POT-Creation-Date: 2004-04-29 03:17+0900\n"
+"POT-Creation-Date: 2004-07-14 15:51+0900\n"
 "PO-Revision-Date: 2003-09-26 03:35+0900\n"
 "Last-Translator: Fumitoshi UKAI <ukai@debian.or.jp>\n"
 "Language-Team: Japanese\n"
@@ -717,6 +717,50 @@
 msgid "B:fixed speed"
 msgstr "B:一定の行数"
 
+#: rc.c:292
+msgid "unspecified"
+msgstr "指定しない"
+
+#: rc.c:293
+msgid "inet inet6"
+msgstr "IPv4優先"
+
+#: rc.c:294
+msgid "inet6 inet"
+msgstr "IPv6優先"
+
+#: rc.c:295
+msgid "inet only"
+msgstr "IPv4のみ"
+
+#: rc.c:296
+msgid "inet6 only"
+msgstr "IPv6のみ"
+
+#: rc.c:303
+msgid "discard"
+msgstr "破棄する"
+
+#: rc.c:305
+msgid "accept"
+msgstr "受け入れる"
+
+#: rc.c:307
+msgid "ask"
+msgstr "確認する"
+
+#: rc.c:317
+msgid "OFF"
+msgstr "無効"
+
+#: rc.c:318
+msgid "Only ISO 2022"
+msgstr "ISO 2022 のみ"
+
+#: rc.c:319
+msgid "ON"
+msgstr "有効"
+
 #: rc.c:666
 msgid "Display Settings"
 msgstr "表示関係"
Index: po/w3m.pot
===================================================================
RCS file: /cvsroot/w3m/w3m/po/w3m.pot,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- po/w3m.pot	28 Apr 2004 18:19:26 -0000	1.3
+++ po/w3m.pot	15 Jul 2004 16:26:04 -0000	1.4
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: ukai@debian.or.jp\n"
-"POT-Creation-Date: 2004-04-29 03:17+0900\n"
+"POT-Creation-Date: 2004-07-14 15:51+0900\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -716,6 +716,50 @@
 msgid "B:fixed speed"
 msgstr ""
 
+#: rc.c:292
+msgid "unspecified"
+msgstr ""
+
+#: rc.c:293
+msgid "inet inet6"
+msgstr ""
+
+#: rc.c:294
+msgid "inet6 inet"
+msgstr ""
+
+#: rc.c:295
+msgid "inet only"
+msgstr ""
+
+#: rc.c:296
+msgid "inet6 only"
+msgstr ""
+
+#: rc.c:303
+msgid "discard"
+msgstr ""
+
+#: rc.c:305
+msgid "accept"
+msgstr ""
+
+#: rc.c:307
+msgid "ask"
+msgstr ""
+
+#: rc.c:317
+msgid "OFF"
+msgstr ""
+
+#: rc.c:318
+msgid "Only ISO 2022"
+msgstr ""
+
+#: rc.c:319
+msgid "ON"
+msgstr ""
+
 #: rc.c:666
 msgid "Display Settings"
 msgstr ""
Index: scripts/w3mmail.cgi.in
===================================================================
RCS file: /cvsroot/w3m/w3m/scripts/w3mmail.cgi.in,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- scripts/w3mmail.cgi.in	22 Sep 2003 21:02:29 -0000	1.13
+++ scripts/w3mmail.cgi.in	30 Aug 2004 16:32:24 -0000	1.14
@@ -1,6 +1,6 @@
 #!@PERL@
 
-$rcsid = q$Id: w3mmail.cgi.in,v 1.13 2003/09/22 21:02:29 ukai Exp $;
+$rcsid = q$Id: w3mmail.cgi.in,v 1.14 2004/08/30 16:32:24 ukai Exp $;
 ($id = $rcsid) =~ s/^.*,v ([\d\.]*).*/$1/;
 ($prog=$0) =~ s/.*\///;
 
@@ -180,6 +180,7 @@
 	    }
 	}
 	($cs,$cte,$body) = &lang_body($body, 1);
+	$body =~ s/\r//g;
 	print MAIL "Mime-Version: 1.0\n";
 	if ($boundary) {
 	    print MAIL "Content-Type: multipart/form-data;\n";
Index: w3mimg/fb/fb_gdkpixbuf.c
===================================================================
RCS file: /cvsroot/w3m/w3m/w3mimg/fb/fb_gdkpixbuf.c,v
retrieving revision 1.16
retrieving revision 1.21
diff -u -r1.16 -r1.21
--- w3mimg/fb/fb_gdkpixbuf.c	13 Jun 2003 15:03:35 -0000	1.16
+++ w3mimg/fb/fb_gdkpixbuf.c	8 Nov 2004 17:14:06 -0000	1.21
@@ -1,17 +1,51 @@
-/* $Id: fb_gdkpixbuf.c,v 1.16 2003/06/13 15:03:35 ukai Exp $ */
+/* $Id: fb_gdkpixbuf.c,v 1.21 2004/11/08 17:14:06 ukai Exp $ */
 /**************************************************************************
                 fb_gdkpixbuf.c 0.3 Copyright (C) 2002, hito
  **************************************************************************/
 
+#include "config.h"
+#if defined(USE_GTK2)
+#include <glib-object.h>
+#include <gdk/gdk.h>
+#endif
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include "fb.h"
 #include "fb_img.h"
 
-static void draw(FB_IMAGE * img, int bg, int x, int y, int w, int h,
+static void draw(FB_IMAGE * img, int x, int y, int w, int h,
 		 GdkPixbuf * pixbuf);
 static GdkPixbuf *resize_image(GdkPixbuf * pixbuf, int width, int height);
 
-static void
+#if defined(USE_GTK2)
+static int
+get_animation_size(GdkPixbufAnimation * animation, int *w, int *h, int *delay)
+{
+    GdkPixbufAnimationIter *iter;
+    int n, i, d = -1;
+    GTimeVal time;
+
+    g_get_current_time(&time);
+    iter = gdk_pixbuf_animation_get_iter(animation, &time);
+    *w = gdk_pixbuf_animation_get_width(animation);
+    *h = gdk_pixbuf_animation_get_height(animation);
+    for (i = 1; 
+	 gdk_pixbuf_animation_iter_on_currently_loading_frame(iter) != TRUE; 
+	 i++) {
+	int tmp;
+	tmp = gdk_pixbuf_animation_iter_get_delay_time(iter);
+	g_time_val_add(&time, tmp * 1000);
+	if (tmp > d)
+	    d = tmp;
+	gdk_pixbuf_animation_iter_advance(iter, &time);
+    }
+    if (delay)
+	*delay = d;
+    n = i;
+    g_object_unref(G_OBJECT(iter));
+    return n;
+}
+#else
+static int
 get_animation_size(GdkPixbufAnimation * animation, int *w, int *h, int *delay)
 {
     GList *frames;
@@ -42,6 +76,16 @@
     }
     if (delay)
 	*delay = d;
+    return n;
+}
+#endif
+
+void
+fb_image_init()
+{
+#if defined(USE_GTK2)
+    g_type_init();
+#endif
 }
 
 int
@@ -50,11 +94,19 @@
     GdkPixbufAnimation *animation;
     if (filename == NULL)
 	return 1;
+#if defined(USE_GTK2)
+    animation = gdk_pixbuf_animation_new_from_file(filename, NULL);
+#else
     animation = gdk_pixbuf_animation_new_from_file(filename);
+#endif
     if (animation == NULL)
 	return 1;
     get_animation_size(animation, w, h, NULL);
+#if defined(USE_GTK2)
+    g_object_unref(G_OBJECT(animation));
+#else
     gdk_pixbuf_animation_unref(animation);
+#endif
     return 0;
 }
 
@@ -62,19 +114,27 @@
 fb_image_load(char *filename, int w, int h, int max_anim)
 {
     GdkPixbufAnimation *animation;
+#if defined(USE_GTK2)
+    GdkPixbufAnimationIter *iter;
+    GTimeVal time;
+#else
+    int i;
     GList *frames;
+#endif
     double ratio_w, ratio_h;
-    int n, i, j, fw, fh, frame_num, delay;
+    int n, j, fw, fh, frame_num, delay;
     FB_IMAGE **fb_frame = NULL, *tmp_image = NULL;
 
     if (filename == NULL)
 	return NULL;
+#if defined(USE_GTK2)
+    animation = gdk_pixbuf_animation_new_from_file(filename, NULL);
+#else
     animation = gdk_pixbuf_animation_new_from_file(filename);
+#endif
     if (animation == NULL)
 	return NULL;
-    frames = gdk_pixbuf_animation_get_frames(animation);
-    get_animation_size(animation, &fw, &fh, &delay);
-    frame_num = n = gdk_pixbuf_animation_get_num_frames(animation);
+    frame_num = n = get_animation_size(animation, &fw, &fh, &delay);
     if (delay <= 0)
 	max_anim = -1;
     if (max_anim < 0) {
@@ -108,6 +168,34 @@
 	fb_image_fill(tmp_image, bg_r, bg_g, bg_b);
     }
 
+#if defined(USE_GTK2)
+    g_get_current_time(&time);
+    iter = gdk_pixbuf_animation_get_iter(animation, &time);
+
+    if (max_anim < 0 && n > -max_anim) {
+	max_anim = n + max_anim;
+	for (j = 0; j < max_anim; j++) {
+	    g_time_val_add(&time, 
+			   gdk_pixbuf_animation_iter_get_delay_time(iter) * 1000);
+	    gdk_pixbuf_animation_iter_advance(iter, &time);
+	}
+    }
+    for (j = 0; j < n; j++) {
+	GdkPixbuf *org_pixbuf, *pixbuf;
+
+	org_pixbuf = gdk_pixbuf_animation_iter_get_pixbuf(iter);
+	pixbuf = resize_image(org_pixbuf, w, h);
+
+	fb_frame[j]->delay = gdk_pixbuf_animation_iter_get_delay_time(iter);
+	g_time_val_add(&time, fb_frame[j]->delay * 1000);
+	draw(fb_frame[j], 0, 0, w, h, pixbuf);
+	if (org_pixbuf != pixbuf)
+	    g_object_unref(G_OBJECT(pixbuf));
+	gdk_pixbuf_animation_iter_advance(iter, &time);
+    }
+#else
+    frames = gdk_pixbuf_animation_get_frames(animation);
+
     for (j = 0; j < n; j++) {
 	GdkPixbufFrame *frame;
 	GdkPixbuf *org_pixbuf, *pixbuf;
@@ -139,13 +227,14 @@
 
 	fb_frame[i]->delay = gdk_pixbuf_frame_get_delay_time(frame);
 	fb_image_copy(fb_frame[i], tmp_image);
-	draw(fb_frame[i], !i, ofstx, ofsty, width, height, pixbuf);
+	draw(fb_frame[i], ofstx, ofsty, width, height, pixbuf);
 
 	switch (gdk_pixbuf_frame_get_action(frame)) {
 	case GDK_PIXBUF_FRAME_RETAIN:
 	    fb_image_copy(tmp_image, fb_frame[i]);
 	    break;
 	case GDK_PIXBUF_FRAME_DISPOSE:
+	    fb_image_fill(tmp_image, bg_r, bg_g, bg_b);
 	    break;
 	case GDK_PIXBUF_FRAME_REVERT:
 	    fb_image_copy(tmp_image, fb_frame[0]);
@@ -157,14 +246,19 @@
 	if (org_pixbuf != pixbuf)
 	    gdk_pixbuf_finalize(pixbuf);
     }
+#endif
   END:
     if (tmp_image)
 	fb_image_free(tmp_image);
+#if defined(USE_GTK2)
+    g_object_unref(G_OBJECT(animation));
+#else
     gdk_pixbuf_animation_unref(animation);
+#endif
     return fb_frame;
 }
 static void
-draw(FB_IMAGE * img, int bg, int x, int y, int w, int h, GdkPixbuf * pixbuf)
+draw(FB_IMAGE * img, int x, int y, int w, int h, GdkPixbuf * pixbuf)
 {
     int i, j, r, g, b, offset, bpp, rowstride;
     guchar *pixels;
Index: w3mimg/fb/fb_img.h
===================================================================
RCS file: /cvsroot/w3m/w3m/w3mimg/fb/fb_img.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- w3mimg/fb/fb_img.h	9 Jul 2003 15:07:11 -0000	1.8
+++ w3mimg/fb/fb_img.h	4 Aug 2004 17:32:28 -0000	1.9
@@ -1,8 +1,9 @@
-/* $Id: fb_img.h,v 1.8 2003/07/09 15:07:11 ukai Exp $ */
+/* $Id: fb_img.h,v 1.9 2004/08/04 17:32:28 ukai Exp $ */
 #ifndef fb_img_header
 #define fb_img_header
 #include "fb.h"
 
+void fb_image_init();
 FB_IMAGE **fb_image_load(char *filename, int w, int h, int n);
 void fb_image_set_bg(int r, int g, int b);
 int fb_image_clear(int x, int y, int w, int h);
Index: w3mimg/fb/fb_imlib2.c
===================================================================
RCS file: /cvsroot/w3m/w3m/w3mimg/fb/fb_imlib2.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- w3mimg/fb/fb_imlib2.c	24 Mar 2003 15:45:59 -0000	1.9
+++ w3mimg/fb/fb_imlib2.c	4 Aug 2004 17:32:28 -0000	1.10
@@ -1,4 +1,4 @@
-/* $Id: fb_imlib2.c,v 1.9 2003/03/24 15:45:59 ukai Exp $ */
+/* $Id: fb_imlib2.c,v 1.10 2004/08/04 17:32:28 ukai Exp $ */
 /**************************************************************************
                 fb_imlib2.c 0.3 Copyright (C) 2002, hito
  **************************************************************************/
@@ -11,6 +11,12 @@
 static void draw(FB_IMAGE * img, Imlib_Image image);
 static Imlib_Image resize_image(Imlib_Image image, int width, int height);
 
+void
+fb_image_init()
+{
+    return;
+}
+
 int
 get_image_size(char *filename, int *w, int *h)
 {
Index: w3mimg/fb/fb_w3mimg.c
===================================================================
RCS file: /cvsroot/w3m/w3m/w3mimg/fb/fb_w3mimg.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- w3mimg/fb/fb_w3mimg.c	29 Aug 2003 15:06:52 -0000	1.13
+++ w3mimg/fb/fb_w3mimg.c	4 Aug 2004 17:32:28 -0000	1.14
@@ -1,4 +1,4 @@
-/* $Id: fb_w3mimg.c,v 1.13 2003/08/29 15:06:52 ukai Exp $ */
+/* $Id: fb_w3mimg.c,v 1.14 2004/08/04 17:32:28 ukai Exp $ */
 #include <stdio.h>
 #include <stdlib.h>
 #include <ctype.h>
@@ -17,6 +17,7 @@
 {
     if (self == NULL)
 	return 0;
+    /* XXX */
     return 1;
 }
 
@@ -195,6 +196,9 @@
     wop->free_image = w3mfb_free_image;
     wop->get_image_size = w3mfb_get_image_size;
 
+    /* XXX */
+    fb_image_init();
+
     return wop;
   error:
     free(wop);
Index: w3mimg/x11/x11_w3mimg.c
===================================================================
RCS file: /cvsroot/w3m/w3m/w3mimg/x11/x11_w3mimg.c,v
retrieving revision 1.25
retrieving revision 1.29
diff -u -r1.25 -r1.29
--- w3mimg/x11/x11_w3mimg.c	13 Jul 2003 16:19:10 -0000	1.25
+++ w3mimg/x11/x11_w3mimg.c	8 Nov 2004 17:14:06 -0000	1.29
@@ -1,6 +1,7 @@
-/* $Id: x11_w3mimg.c,v 1.25 2003/07/13 16:19:10 ukai Exp $ */
+/* $Id: x11_w3mimg.c,v 1.29 2004/11/08 17:14:06 ukai Exp $ */
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <ctype.h>
 #include "config.h"
 
@@ -11,7 +12,13 @@
 #include <X11/Xutil.h>
 #include <Imlib2.h>
 #elif defined(USE_GDKPIXBUF)
+#if defined(USE_GTK2)
+#include <glib-object.h>
+#include <gdk/gdk.h>
+#include <gdk-pixbuf-xlib/gdk-pixbuf-xlib.h>
+#else
 #include <gdk-pixbuf/gdk-pixbuf-xlib.h>
+#endif
 #else
 #error no Imlib and GdkPixbuf support
 #endif
@@ -42,7 +49,36 @@
     Pixmap *pixmap;
 };
 
-static void
+#if defined(USE_GTK2)
+static int
+get_animation_size(GdkPixbufAnimation * animation, int *w, int *h, int *delay)
+{
+    GdkPixbufAnimationIter *iter;
+    int n, i, d = -1;
+    GTimeVal time;
+
+    g_get_current_time(&time);
+    iter = gdk_pixbuf_animation_get_iter(animation, &time);
+    *w = gdk_pixbuf_animation_get_width(animation);
+    *h = gdk_pixbuf_animation_get_height(animation);
+    for (i = 1;
+	 gdk_pixbuf_animation_iter_on_currently_loading_frame(iter) != TRUE;
+	 i++) {
+	int tmp;
+	tmp = gdk_pixbuf_animation_iter_get_delay_time(iter);
+	g_time_val_add(&time, tmp * 1000);
+	if (tmp > d)
+	    d = tmp;
+	gdk_pixbuf_animation_iter_advance(iter, &time);
+    }
+    if (delay)
+	*delay = d;
+    g_object_unref(G_OBJECT(iter));
+    n = i;
+    return n;
+}
+#else
+static int
 get_animation_size(GdkPixbufAnimation * animation, int *w, int *h, int *delay)
 {
     GList *frames;
@@ -73,8 +109,9 @@
     }
     if (delay)
 	*delay = d;
+    return n;
 }
-
+#endif
 #endif
 
 static int
@@ -94,6 +131,9 @@
     }
 #elif defined(USE_GDKPIXBUF)
     if (!xi->init_flag) {
+#if defined(USE_GTK2)
+	g_type_init();
+#endif
 	gdk_pixbuf_xlib_init(xi->display, 0);
 	xi->init_flag = TRUE;
     }
@@ -290,11 +330,17 @@
     Imlib_Image im;
 #elif defined(USE_GDKPIXBUF)
     GdkPixbufAnimation *animation;
-    GList *frames;
-    int i, j, iw, ih, n, frame_num, delay, max_anim;
+    int j, iw, ih, n, frame_num, delay = -1, max_anim;
     double ratio_w, ratio_h;
     struct x11_image *ximg;
     Pixmap tmp_pixmap;
+#if defined(USE_GTK2)
+    GdkPixbufAnimationIter *iter;
+    GTimeVal time;
+#else
+    int i;
+    GList *frames;
+#endif
 #endif
 
     if (self == NULL)
@@ -342,13 +388,14 @@
     imlib_free_image();
 #elif defined(USE_GDKPIXBUF)
     max_anim = self->max_anim;
+#if defined(USE_GTK2)
+    animation = gdk_pixbuf_animation_new_from_file(fname, NULL);
+#else
     animation = gdk_pixbuf_animation_new_from_file(fname);
+#endif
     if (!animation)
 	return 0;
-    frames = gdk_pixbuf_animation_get_frames(animation);
-    frame_num = n = gdk_pixbuf_animation_get_num_frames(animation);
-
-    get_animation_size(animation, &iw, &ih, &delay);
+    frame_num = n = get_animation_size(animation, &iw, &ih, &delay);
     if (delay <= 0)
 	max_anim = -1;
 
@@ -370,17 +417,64 @@
     }
     tmp_pixmap = XCreatePixmap(xi->display, xi->parent, w, h,
 			       DefaultDepth(xi->display, 0));
+    XSetForeground(xi->display, xi->imageGC, xi->background_pixel);
     XFillRectangle(xi->display, (Pixmap) tmp_pixmap, xi->imageGC, 0, 0, w, h);
     if (!tmp_pixmap) {
+#if defined(USE_GTK2)
+	g_object_unref(G_OBJECT(animation));
+#else
 	gdk_pixbuf_animation_unref(animation);
+#endif
 	return 0;
     }
     ximg = x11_img_new(xi, w, h, frame_num);
     if (!ximg) {
 	XFreePixmap(xi->display, tmp_pixmap);
+#if defined(USE_GTK2)
+	g_object_unref(G_OBJECT(animation));
+#else
 	gdk_pixbuf_animation_unref(animation);
+#endif
 	return 0;
     }
+#if defined(USE_GTK2)
+    g_get_current_time(&time);
+    iter = gdk_pixbuf_animation_get_iter(animation, &time);
+
+   if (max_anim < 0 && n > -max_anim) {
+	max_anim = n + max_anim;
+	for (j = 0; j < max_anim; j++) {
+	    delay = gdk_pixbuf_animation_iter_get_delay_time(iter);
+	    g_time_val_add(&time, delay * 1000);
+	    gdk_pixbuf_animation_iter_advance(iter, &time);
+	}
+    }
+    for (j = 0; j < frame_num; j++) {
+	GdkPixbuf *org_pixbuf, *pixbuf;
+
+	org_pixbuf = gdk_pixbuf_animation_iter_get_pixbuf(iter);
+	delay = gdk_pixbuf_animation_iter_get_delay_time(iter);
+	pixbuf = resize_image(org_pixbuf, w, h);
+
+	if (delay > ximg->delay)
+	    ximg->delay = delay;
+
+	gdk_pixbuf_xlib_render_to_drawable_alpha(pixbuf,
+						 (Drawable) ximg->pixmap[j], 0,
+						 0, 0, 0, w, h,
+						 GDK_PIXBUF_ALPHA_BILEVEL, 1,
+						 XLIB_RGB_DITHER_NORMAL, 0, 0);
+	if (org_pixbuf != pixbuf)
+	    g_object_unref(G_OBJECT(pixbuf));
+	g_time_val_add(&time, delay * 1000);
+	gdk_pixbuf_animation_iter_advance(iter, &time);
+    }
+    XFreePixmap(xi->display, tmp_pixmap);
+    g_object_unref(G_OBJECT(animation));
+
+#else
+    frames = gdk_pixbuf_animation_get_frames(animation);
+
     for (j = 0; j < n; j++) {
 	GdkPixbufFrame *frame;
 	GdkPixbuf *org_pixbuf, *pixbuf;
@@ -430,6 +524,9 @@
 		      xi->imageGC, 0, 0, w, h, 0, 0);
 	    break;
 	case GDK_PIXBUF_FRAME_DISPOSE:
+	    XSetForeground(xi->display, xi->imageGC, xi->background_pixel);
+	    XFillRectangle(xi->display, tmp_pixmap, xi->imageGC,
+			   0, 0, w, h);
 	    break;
 	case GDK_PIXBUF_FRAME_REVERT:
 	    XCopyArea(xi->display, ximg->pixmap[0], tmp_pixmap,
@@ -448,6 +545,7 @@
     }
     XFreePixmap(xi->display, tmp_pixmap);
     gdk_pixbuf_animation_unref(animation);
+#endif
     img->pixmap = ximg;
 #endif
 
@@ -577,13 +675,21 @@
     *h = imlib_image_get_height();
     imlib_free_image();
 #elif defined(USE_GDKPIXBUF)
+#if defined(USE_GTK2)
+    animation = gdk_pixbuf_animation_new_from_file(fname, NULL);
+#else
     animation = gdk_pixbuf_animation_new_from_file(fname);
+#endif
     if (!animation)
 	return 0;
 
     get_animation_size(animation, w, h, NULL);
+#if defined(USE_GTK2)
+    g_object_unref(G_OBJECT(animation));
+#else
     gdk_pixbuf_animation_unref(animation);
 #endif
+#endif
     return 1;
 }