Index: configure.in
===================================================================
RCS file: /cvs/gnome/gtk+/configure.in,v
retrieving revision 1.271
diff -u -b -B -p -r1.271 configure.in
--- configure.in	2 Apr 2002 12:10:31 -0000	1.271
+++ configure.in	10 Apr 2002 18:48:07 -0000
@@ -633,6 +633,7 @@ dnl We allow people to disable image loa
 dnl out so that people don't accidentally build without them.
 
 AC_ARG_WITH(libpng,  [  --without-libpng	  disable PNG loader for gdk-pixbuf])
+AC_ARG_WITH(libmng,  [  --without-libmng	  disable MNG loader for gdk-pixbuf])
 AC_ARG_WITH(libjpeg, [  --without-libjpeg	  disable JPEG loader for gdk-pixbuf])
 AC_ARG_WITH(libtiff, [  --without-libtiff	  disable TIFF loader for gdk-pixbuf])
 
@@ -736,9 +737,25 @@ dnl Test for libpng
 *** from CVS.])
   fi
 
+dnl Test for libmng
+  if test x$with_libmng != xno && test -z "$LIBMNG"; then
+     AC_CHECK_LIB(mng, mng_initialize,
+       [AC_CHECK_HEADER(libmng.h,
+          mng_ok=yes,
+          mng_ok=no)],
+        AC_MSG_WARN(*** MNG loader will not be built (MNG library not found) ***), -lz -lm)
+     AC_MSG_RESULT($mng_ok)
+     if test "$mng_ok" = yes; then
+       MNG='mng'; LIBMNG='-lmng -lz'
+     else
+        AC_MSG_WARN(*** MNG loader will not be built (MNG header file not found) ***)
+     fi
+  fi
+
 AC_SUBST(LIBTIFF)
 AC_SUBST(LIBJPEG)
 AC_SUBST(LIBPNG)
+AC_SUBST(LIBMNG)
 
 AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
 
@@ -758,7 +775,7 @@ else
    fi
 fi
 
-all_loaders="png,bmp,wbmp,gif,ico,jpeg,pnm,ras,tiff,xpm,tga"
+all_loaders="png,mng,bmp,wbmp,gif,ico,jpeg,pnm,ras,tiff,xpm,tga"
 included_loaders=""
 # If no loaders specified, include all
 if test "x$with_included_loaders" = xyes ; then
@@ -793,6 +810,7 @@ AC_TYPE_SIGNAL
 
 AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x)
 AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
+AM_CONDITIONAL(HAVE_MNG, test "x$LIBMNG" != x)
 AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
 
 if $dynworks ; then
@@ -806,8 +824,11 @@ if $dynworks ; then
   if echo "$included_loaders" | grep "\(^\|\,\)png\(\$\|\,\)" > /dev/null; then
     STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBPNG"
   fi
+  if echo "$included_loaders" | grep "\(^\|\,\)mng\(\$\|\,\)" > /dev/null; then
+    STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBMNG"
+  fi
 else
-  STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG"
+  STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG $LIBMNG"
 fi
 
 # Checks to see if we should compile in MMX support (there will be
Index: gdk-pixbuf/Makefile.am
===================================================================
RCS file: /cvs/gnome/gtk+/gdk-pixbuf/Makefile.am,v
retrieving revision 1.119
diff -u -b -B -p -r1.119 Makefile.am
--- gdk-pixbuf/Makefile.am	5 Mar 2002 21:04:01 -0000	1.119
+++ gdk-pixbuf/Makefile.am	10 Apr 2002 18:48:08 -0000
@@ -55,6 +55,14 @@ libpixbufloader_png_la_LIBADD = $(LIBPNG
 libpixbufloader_static_png_la_SOURCES = io-png.c
 
 #
+# The MNG loader.
+#
+libpixbufloader_mng_la_SOURCES = io-mng.c
+libpixbufloader_mng_la_LDFLAGS = -avoid-version -module $(no_undefined)
+libpixbufloader_mng_la_LIBADD = $(LIBMNG) $(module_libs)
+libpixbufloader_static_mng_la_SOURCES = io-mng.c
+
+#
 # The JPEG loader
 #
 libpixbufloader_static_jpeg_la_SOURCES = io-jpeg.c
@@ -146,6 +154,10 @@ if HAVE_PNG
 PNG_LIB = libpixbufloader-png.la
 endif
 
+if HAVE_MNG
+MNG_LIB = libpixbufloader-mng.la
+endif
+
 if HAVE_JPEG
 JPEG_LIB = libpixbufloader-jpeg.la
 endif
@@ -176,6 +188,7 @@ if BUILD_DYNAMIC_MODULES
 
 loader_LTLIBRARIES = 	\
 	$(PNG_LIB)	\
+	$(MNG_LIB)	\
 	$(JPEG_LIB)	\
 	$(GIF_LIB)	\
 	$(ICO_LIB)	\
@@ -196,6 +209,7 @@ loader_LTLIBRARIES = 
 
 noinst_LTLIBRARIES =  	\
 	libpixbufloader-static-png.la \
+	libpixbufloader-static-mng.la \
 	libpixbufloader-static-jpeg.la \
 	libpixbufloader-static-gif.la  \
 	libpixbufloader-static-ico.la  \
@@ -375,6 +389,7 @@ EXTRA_DIST =			\
 	pixbufloader_ras.def		\
 	pixbufloader_gif.def		\
 	pixbufloader_png.def		\
+	pixbufloader_mng.def		\
 	pixbufloader_tiff.def		\
 	pixbufloader_wbmp.def		\
 	pixbufloader_xbm.def		\
Index: gdk-pixbuf/gdk-pixbuf-io.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk-pixbuf/gdk-pixbuf-io.c,v
retrieving revision 1.66
diff -u -b -B -p -r1.66 gdk-pixbuf-io.c
--- gdk-pixbuf/gdk-pixbuf-io.c	20 Mar 2002 21:46:42 -0000	1.66
+++ gdk-pixbuf/gdk-pixbuf-io.c	10 Apr 2002 18:48:11 -0000
@@ -56,6 +56,25 @@ pixbuf_check_png (guchar *buffer, int si
 }
 
 static gboolean
+pixbuf_check_mng (guchar *buffer, int size)
+{
+	if (size < 28)
+		return FALSE;
+
+	if (buffer [0] != 0x8a ||
+	    buffer [1] != 'M' ||
+	    buffer [2] != 'N' ||
+	    buffer [3] != 'G' ||
+	    buffer [4] != 0x0d ||
+	    buffer [5] != 0x0a ||
+	    buffer [6] != 0x1a ||
+	    buffer [7] != 0x0a)
+		return FALSE;
+
+	return TRUE;
+}
+
+static gboolean
 pixbuf_check_jpeg (guchar *buffer, int size)
 {
 	if (size < 10)
@@ -226,6 +245,7 @@ pixbuf_check_tga (guchar *buffer, int si
 
 static GdkPixbufModule file_formats [] = {
 	{ "png",  pixbuf_check_png, NULL,  NULL, NULL, NULL, NULL, NULL, NULL, },
+	{ "mng",  pixbuf_check_mng, NULL,  NULL, NULL, NULL, NULL, NULL, NULL, },
 	{ "jpeg", pixbuf_check_jpeg, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
 	{ "tiff", pixbuf_check_tiff, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
 	{ "gif",  pixbuf_check_gif, NULL,  NULL, NULL, NULL, NULL, NULL, NULL },
@@ -385,6 +405,7 @@ _gdk_pixbuf_load_module (GdkPixbufModule
 #define m_fill_vtable(type) extern void mname(type,fill_vtable) (GdkPixbufModule *module)
 
 m_fill_vtable (png);
+m_fill_vtable (mng);
 m_fill_vtable (bmp);
 m_fill_vtable (wbmp);
 m_fill_vtable (gif);
@@ -414,6 +435,12 @@ _gdk_pixbuf_load_module (GdkPixbufModule
 	}
 #endif
 
+#ifdef INCLUDE_mng	
+	else if (strcmp (image_module->module_name, "mng") == 0){
+                fill_vtable = mname (mng, fill_vtable);
+	}
+#endif
+
 #ifdef INCLUDE_bmp	
 	else if (strcmp (image_module->module_name, "bmp") == 0){
                 fill_vtable = mname (bmp, fill_vtable);
