Bug 504822 - Remove XBM support from Mozilla. r=joe sr=vladimir
authorBobby Holley <bobbyholley@stanford.edu>
Wed, 29 Jul 2009 10:13:08 -0400
changeset 30829 e3c9ab74bbdd752b1431ae3028f844854e03c0a1
parent 30828 b279d6505530c0f9d130e01a2c6db1c57c1f4720
child 30830 d15d5d9abfd1e531205073a13a7f140ea82fe431
push idunknown
push userunknown
push dateunknown
reviewersjoe, vladimir
bugs504822
milestone1.9.2a1pre
Bug 504822 - Remove XBM support from Mozilla. r=joe sr=vladimir
browser/components/nsBrowserContentHandler.js
configure.in
embedding/config/gre-installer-win.pkg
embedding/config/gre-win
modules/libpr0n/build/nsImageModule.cpp
modules/libpr0n/decoders/xbm/Makefile.in
modules/libpr0n/decoders/xbm/nsXBMDecoder.cpp
modules/libpr0n/decoders/xbm/nsXBMDecoder.h
modules/libpr0n/src/imgLoader.cpp
toolkit/locales/en-US/chrome/global/filepicker.properties
toolkit/toolkit-makefiles.sh
widget/src/xpwidgets/nsBaseFilePicker.cpp
--- a/browser/components/nsBrowserContentHandler.js
+++ b/browser/components/nsBrowserContentHandler.js
@@ -904,17 +904,16 @@ var Module = {
     registerType("text/plain");
     registerType("image/gif");
     registerType("image/jpeg");
     registerType("image/jpg");
     registerType("image/png");
     registerType("image/bmp");
     registerType("image/x-icon");
     registerType("image/vnd.microsoft.icon");
-    registerType("image/x-xbitmap");
     registerType("application/http-index-format");
 
     var catMan = Components.classes["@mozilla.org/categorymanager;1"]
                            .getService(nsICategoryManager);
 
     catMan.addCategoryEntry("command-line-handler",
                             "m-browser",
                             bch_contractID, true, true);
--- a/configure.in
+++ b/configure.in
@@ -4503,17 +4503,17 @@ MOZ_ARG_HEADER(Application)
 BUILD_STATIC_LIBS=
 ENABLE_TESTS=1
 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
 MOZ_BRANDING_DIRECTORY=
 MOZ_DBGRINFO_MODULES=
 MOZ_ENABLE_CANVAS=1
 MOZ_ENABLE_CANVAS3D=
 MOZ_FEEDS=1
-MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp xbm icon"
+MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp icon"
 MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
 MOZ_JAVAXPCOM=
 MOZ_JSDEBUGGER=1
 MOZ_JSLOADER=1
 MOZ_MATHML=1
 MOZ_MORK=1
 MOZ_MORKREADER=
 MOZ_AUTH_EXTENSION=1
--- a/embedding/config/gre-installer-win.pkg
+++ b/embedding/config/gre-installer-win.pkg
@@ -33,17 +33,16 @@ components\history.xpt
 ; html parser
 ;
 components\htmlparser.xpt
 
 ;
 ; imagelib
 ;
 components\imgbmp.dll
-components\imgxbm.dll
 components\imgicon.dll
 components\imgicon.xpt
 components\imglib2.xpt
 
 ;
 ; l10n libraries
 ;
 components\universalchardet.dll
--- a/embedding/config/gre-win
+++ b/embedding/config/gre-win
@@ -21,17 +21,16 @@ components\history.xpt
 ; html parser
 ;
 components\htmlparser.xpt
 
 ;
 ; imagelib
 ;
 components\imgbmp.dll
-components\imgxbm.dll
 components\imgicon.dll
 components\imgicon.xpt
 components\imglib2.xpt
 
 ;
 ; l10n libraries
 ;
 components\universalchardet.dll
--- a/modules/libpr0n/build/nsImageModule.cpp
+++ b/modules/libpr0n/build/nsImageModule.cpp
@@ -39,17 +39,16 @@
 
 #include "nsImgBuildDefines.h"
 
 #ifdef XP_MAC
 #define IMG_BUILD_gif 1
 #define IMG_BUILD_bmp 1
 #define IMG_BUILD_png 1
 #define IMG_BUILD_jpeg 1
-#define IMG_BUILD_xbm 1
 #endif
 
 #include "nsIDeviceContext.h"
 #include "nsIGenericFactory.h"
 #include "nsIModule.h"
 #include "nsICategoryManager.h"
 #include "nsXPCOMCID.h"
 #include "nsServiceManagerUtils.h"
@@ -76,22 +75,16 @@
 #include "nsPNGDecoder.h"
 #endif
 
 #ifdef IMG_BUILD_DECODER_jpeg
 // jpeg
 #include "nsJPEGDecoder.h"
 #endif
 
-#ifdef IMG_BUILD_DECODER_xbm
-// xbm
-#include "nsXBMDecoder.h"
-#endif
-
-
 #ifdef IMG_BUILD_ENCODER_png
 // png
 #include "nsPNGEncoder.h"
 #endif
 #ifdef IMG_BUILD_ENCODER_jpeg
 // jpeg
 #include "nsJPEGEncoder.h"
 #endif
@@ -128,21 +121,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsBMPDeco
 // png
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsPNGDecoder)
 #endif
 #ifdef IMG_BUILD_ENCODER_png
 // png
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsPNGEncoder)
 #endif
 
-#ifdef IMG_BUILD_DECODER_xbm
-// xbm
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsXBMDecoder)
-#endif
-
 static const char* gImageMimeTypes[] = {
 #ifdef IMG_BUILD_DECODER_gif
   "image/gif",
 #endif
 #ifdef IMG_BUILD_DECODER_jpeg
   "image/jpeg",
   "image/pjpeg",
   "image/jpg",
@@ -152,21 +140,16 @@ static const char* gImageMimeTypes[] = {
   "image/vnd.microsoft.icon",
   "image/bmp",
   "image/x-ms-bmp",
 #endif
 #ifdef IMG_BUILD_DECODER_png
   "image/png",
   "image/x-png",
 #endif
-#ifdef IMG_BUILD_DECODER_xbm
-  "image/x-xbitmap",
-  "image/x-xbm",
-  "image/xbm"
-#endif
 };
 
 static NS_METHOD ImageRegisterProc(nsIComponentManager *aCompMgr,
                                    nsIFile *aPath,
                                    const char *registryLocation,
                                    const char *componentType,
                                    const nsModuleComponentInfo *info) {
   nsresult rv;
@@ -288,32 +271,16 @@ static const nsModuleComponentInfo compo
 #endif
 #ifdef IMG_BUILD_ENCODER_png
   // png
   { "PNG Encoder",
     NS_PNGENCODER_CID,
     "@mozilla.org/image/encoder;2?type=image/png",
     nsPNGEncoderConstructor, },
 #endif
-
-#ifdef IMG_BUILD_DECODER_xbm
-  // xbm
-  { "XBM Decoder",
-     NS_XBMDECODER_CID,
-     "@mozilla.org/image/decoder;2?type=image/x-xbitmap",
-     nsXBMDecoderConstructor, },
-  { "XBM Decoder",
-     NS_XBMDECODER_CID,
-     "@mozilla.org/image/decoder;2?type=image/x-xbm",
-     nsXBMDecoderConstructor, },
-  { "XBM Decoder",
-     NS_XBMDECODER_CID,
-     "@mozilla.org/image/decoder;2?type=image/xbm",
-     nsXBMDecoderConstructor, },
-#endif
 };
 
 static nsresult
 imglib_Initialize(nsIModule* aSelf)
 {
   // Hack: We need the gfx module to be initialized because we use gfxPlatform
   // in imgFrame. Request something from the gfx module to ensure that
   // everything's set up for us.
deleted file mode 100644
--- a/modules/libpr0n/decoders/xbm/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2001
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Christian Biesinger <cbiesinger@web.de>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH		= ../../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE          = imgxbm
-LIBRARY_NAME    = imgxbm_s
-FORCE_STATIC_LIB = 1
-MODULE_NAME     = nsXBMModule
-LIBXUL_LIBRARY  = 1
-
-REQUIRES	= xpcom \
-			  string \
-			  gfx \
-			  thebes \
-			  imglib2 \
-			  $(NULL)
-
-CPPSRCS        = nsXBMDecoder.cpp
-
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/modules/libpr0n/decoders/xbm/nsXBMDecoder.cpp
+++ /dev/null
@@ -1,292 +0,0 @@
-/* vim:set tw=80 expandtab softtabstop=4 ts=4 sw=4: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Mozilla XBM Decoder.
- *
- * The Initial Developer of the Original Code is
- * Christian Biesinger <cbiesinger@web.de>.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Aaron Kaluszka <ask@swva.net>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/* KNOWN BUGS:
- * o first #define line is assumed to be width, second height */
-
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include "nsXBMDecoder.h"
-
-#include "nsIInputStream.h"
-#include "nsIComponentManager.h"
-#include "nsIInterfaceRequestorUtils.h"
-
-#include "imgILoad.h"
-
-#include "nsIProperties.h"
-#include "nsISupportsPrimitives.h"
-
-#include "gfxColor.h"
-#include "nsIInterfaceRequestorUtils.h"
-
-// Static colormap
-static const PRUint32 kColors[2] = {
-    GFX_PACKED_PIXEL(0, 0, 0, 0),     // Transparent 
-    GFX_PACKED_PIXEL(255, 0, 0, 0)    // Black
-};
-
-NS_IMPL_ISUPPORTS1(nsXBMDecoder, imgIDecoder)
-
-nsXBMDecoder::nsXBMDecoder() : mBuf(nsnull), mPos(nsnull), mImageData(nsnull)
-{
-}
-
-nsXBMDecoder::~nsXBMDecoder()
-{
-    if (mBuf)
-        free(mBuf);
-}
-
-NS_IMETHODIMP nsXBMDecoder::Init(imgILoad *aLoad)
-{
-    nsresult rv;
-    mObserver = do_QueryInterface(aLoad);
-
-    mImage = do_CreateInstance("@mozilla.org/image/container;2", &rv);
-    if (NS_FAILED(rv))
-        return rv;
-
-    aLoad->SetImage(mImage);
-
-    mCurRow = mBufSize = mWidth = mHeight = 0;
-    mState = RECV_HEADER;
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP nsXBMDecoder::Close()
-{
-    mImage->DecodingComplete();
-
-    mObserver->OnStopContainer(nsnull, mImage);
-    mObserver->OnStopDecode(nsnull, NS_OK, nsnull);
-    mObserver = nsnull;
-    mImage = nsnull;
-    mImageData = nsnull;
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP nsXBMDecoder::Flush()
-{
-    return NS_OK;
-}
-
-NS_METHOD nsXBMDecoder::ReadSegCb(nsIInputStream* aIn, void* aClosure,
-                             const char* aFromRawSegment, PRUint32 aToOffset,
-                             PRUint32 aCount, PRUint32 *aWriteCount) {
-    nsXBMDecoder *decoder = reinterpret_cast<nsXBMDecoder*>(aClosure);
-    *aWriteCount = aCount;
-
-    nsresult rv = decoder->ProcessData(aFromRawSegment, aCount);
-
-    if (NS_FAILED(rv)) {
-        *aWriteCount = 0;
-    }
-
-    return rv;
-}
-
-NS_IMETHODIMP nsXBMDecoder::WriteFrom(nsIInputStream *aInStr, PRUint32 aCount, PRUint32 *aRetval)
-{
-    nsresult rv = aInStr->ReadSegments(ReadSegCb, this, aCount, aRetval);
-    
-    if (aCount != *aRetval) { 
-        *aRetval = aCount; 
-        return NS_ERROR_FAILURE; 
-    }
-    
-    return rv;    
-}
-
-nsresult nsXBMDecoder::ProcessData(const char* aData, PRUint32 aCount) {
-    char *endPtr;
-    // calculate the offset since the absolute position might no longer
-    // be valid after realloc
-    const PRPtrdiff posOffset = mPos ? (mPos - mBuf) : 0;
-
-    // expand the buffer to hold the new data
-    char* oldbuf = mBuf;
-    PRUint32 newbufsize = mBufSize + aCount + 1;
-    if (newbufsize < mBufSize)
-        mBuf = nsnull;  // size wrapped around, give up
-    else
-        mBuf = (char*)realloc(mBuf, newbufsize);
-
-    if (!mBuf) {
-        mState = RECV_DONE;
-        if (oldbuf)
-            free(oldbuf);
-        return NS_ERROR_OUT_OF_MEMORY;
-    }
-    memcpy(mBuf + mBufSize, aData, aCount);
-    mBufSize += aCount;
-    mBuf[mBufSize] = 0;
-    mPos = mBuf + posOffset;
-
-    // process latest data according to current state
-    if (mState == RECV_HEADER) {
-        mPos = strstr(mBuf, "#define");
-        if (!mPos)
-            // #define not found. return for now, waiting for more data.
-            return NS_OK;
-
-        // Convert width and height to numbers.  Convert hotspot for cursor functionality, if present
-        if (sscanf(mPos, "#define %*s %u #define %*s %u #define %*s %u #define %*s %u unsigned", &mWidth, &mHeight, &mXHotspot, &mYHotspot) == 4)
-            mIsCursor = PR_TRUE;
-        else if (sscanf(mPos, "#define %*s %u #define %*s %u unsigned", &mWidth, &mHeight) == 2)
-            mIsCursor = PR_FALSE;
-        else
-             // No identifiers found.  Return for now, waiting for more data.
-            return NS_OK;
-
-        // Check for X11 flavor
-        if (strstr(mPos, " char "))
-            mIsX10 = PR_FALSE;
-        // Check for X10 flavor
-        else if (strstr(mPos, " short "))
-            mIsX10 = PR_TRUE;
-        else
-            // Neither identifier found.  Return for now, waiting for more data.
-            return NS_OK;
-
-        mImage->Init(mWidth, mHeight, mObserver);
-        mObserver->OnStartContainer(nsnull, mImage);
-
-        PRUint32 imageLen;
-        nsresult rv = mImage->AppendFrame(0, 0, mWidth, mHeight, gfxASurface::ImageFormatARGB32,
-                                          (PRUint8**)&mImageData, &imageLen);
-        if (NS_FAILED(rv))
-            return rv;
-
-        if (mIsCursor) {
-            nsCOMPtr<nsIProperties> props(do_QueryInterface(mImage));
-            if (props) {
-                nsCOMPtr<nsISupportsPRUint32> intwrapx = do_CreateInstance("@mozilla.org/supports-PRUint32;1");
-                nsCOMPtr<nsISupportsPRUint32> intwrapy = do_CreateInstance("@mozilla.org/supports-PRUint32;1");
-
-                if (intwrapx && intwrapy) {
-                    intwrapx->SetData(mXHotspot);
-                    intwrapy->SetData(mYHotspot);
-
-                    props->Set("hotspotX", intwrapx);
-                    props->Set("hotspotY", intwrapy);
-                }
-            }
-        }
-
-        mObserver->OnStartFrame(nsnull, 0);
-
-        mState = RECV_SEEK;
-
-        mCurRow = 0;
-        mCurCol = 0;
-
-    }
-    if (mState == RECV_SEEK) {
-        if ((endPtr = strchr(mPos, '{')) != NULL) {
-            mPos = endPtr+1;
-            mState = RECV_DATA;
-        } else {
-            mPos = mBuf + mBufSize;
-            return NS_OK;
-        }
-    }
-    if (mState == RECV_DATA) {
-        PRUint32 *ar = mImageData + mCurRow * mWidth + mCurCol;
-
-        do {
-            PRUint32 pixel = strtoul(mPos, &endPtr, 0);
-            if (endPtr == mPos)
-                return NS_OK;   // no number to be found - need more data
-            if (!*endPtr)
-                return NS_OK;   // number at the end - might be missing a digit
-            if (pixel == 0 && *endPtr == 'x')
-                return NS_OK;   // 0x at the end, actual number is missing
-            while (*endPtr && isspace(*endPtr))
-                endPtr++;       // skip whitespace looking for comma
-
-            if (!*endPtr) {
-                // Need more data
-                return NS_OK;
-            }
-            if (*endPtr != ',') {
-                *endPtr = '\0';
-                mState = RECV_DONE;  // strange character (or ending '}')
-            } else {
-                // Skip the comma
-                endPtr++;
-            }
-            mPos = endPtr;
-            PRUint32 numPixels = 8;
-            if (mIsX10) { // X10 use 16bits values, but bytes are swapped
-                pixel = (pixel >> 8) | ((pixel&0xFF) << 8);
-                numPixels = 16;
-            }
-            numPixels = PR_MIN(numPixels, mWidth - mCurCol);
-            for (PRUint32 i = numPixels; i > 0; --i) {
-                *ar++ = kColors[pixel & 1];
-                pixel >>= 1;
-            }
-            mCurCol += numPixels;
-            if (mCurCol == mWidth || mState == RECV_DONE) {
-                nsIntRect r(0, mCurRow, mWidth, 1);
-                nsresult rv = mImage->FrameUpdated(0, r);
-                if (NS_FAILED(rv)) {
-                  return rv;
-                }
-
-                mObserver->OnDataAvailable(nsnull, PR_TRUE, &r);
-
-                mCurRow++;
-                if (mCurRow == mHeight) {
-                    mState = RECV_DONE;
-                    return mObserver->OnStopFrame(nsnull, 0);
-                }
-                mCurCol = 0;
-            }
-        } while ((mState == RECV_DATA) && *mPos);
-    }
-
-    return NS_OK;
-}
-
-
deleted file mode 100644
--- a/modules/libpr0n/decoders/xbm/nsXBMDecoder.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* vim:set tw=80 expandtab softtabstop=4 ts=4 sw=4: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Mozilla XBM Decoder.
- *
- * The Initial Developer of the Original Code is
- * Christian Biesinger <cbiesinger@web.de>.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Aaron Kaluszka <ask@swva.net>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-#ifndef _nsXBMDecoder_h
-#define _nsXBMDecoder_h
-
-#include "nsCOMPtr.h"
-#include "imgIDecoder.h"
-#include "imgIContainer.h"
-#include "imgIDecoderObserver.h"
-
-#define NS_XBMDECODER_CID \
-{ /* {dbfd145d-3298-4f3c-902f-2c5e1a1494ce} */ \
-  0xdbfd145d, \
-  0x3298, \
-  0x4f3c, \
-  { 0x90, 0x2f, 0x2c, 0x5e, 0x1a, 0x14, 0x94, 0xce } \
-}
-
-class nsXBMDecoder : public imgIDecoder
-{
-public:
-    NS_DECL_ISUPPORTS
-    NS_DECL_IMGIDECODER
-
-    nsXBMDecoder();
-    virtual ~nsXBMDecoder();
-
-    nsresult ProcessData(const char* aData, PRUint32 aCount);
-private:
-    static NS_METHOD ReadSegCb(nsIInputStream* aIn, void* aClosure,
-                               const char* aFromRawSegment, PRUint32 aToOffset,
-                               PRUint32 aCount, PRUint32 *aWriteCount);
-
-    nsCOMPtr<imgIDecoderObserver> mObserver;
-
-    nsCOMPtr<imgIContainer> mImage;
-
-    PRUint32 mCurRow;
-    PRUint32 mCurCol;
-
-    char* mBuf; // Holds the received data
-    char* mPos;
-    PRUint32 mBufSize; // number of bytes in mBuf
-
-    PRUint32 mWidth;
-    PRUint32 mHeight;
-    PRUint32 mXHotspot;
-    PRUint32 mYHotspot;
-
-    PRUint32* mImageData;    // Pointer into the Cairo image data
-
-    PRPackedBool mIsCursor;
-    PRPackedBool mIsX10; // X10 flavor XBM?
-
-    enum {
-        RECV_HEADER,
-        RECV_SEEK,
-        RECV_DATA,
-        RECV_DONE
-    } mState;
-};
-
-
-#endif
--- a/modules/libpr0n/src/imgLoader.cpp
+++ b/modules/libpr0n/src/imgLoader.cpp
@@ -1676,19 +1676,16 @@ nsresult imgLoader::GetMimeTypeFromConte
 
   // ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
   // CURs begin with 2-byte 0 followed by 2-byte 2.
   else if (aLength >= 4 && (!memcmp(aContents, "\000\000\001\000", 4) ||
                             !memcmp(aContents, "\000\000\002\000", 4))) {
     aContentType.AssignLiteral("image/x-icon");
   }
 
-  else if (aLength >= 8 && !nsCRT::strncmp(aContents, "#define ", 8)) {
-    aContentType.AssignLiteral("image/x-xbitmap");
-  }
   else {
     /* none of the above?  I give up */
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   return NS_OK;
 }
 
--- a/toolkit/locales/en-US/chrome/global/filepicker.properties
+++ b/toolkit/locales/en-US/chrome/global/filepicker.properties
@@ -2,17 +2,16 @@
 # --do not localize the extensions, only the titles
 allTitle=All Files
 allFilter=*
 htmlTitle=HTML Files
 htmlFilter=*.html; *.htm; *.shtml; *.xhtml
 textTitle=Text Files
 textFilter=*.txt; *.text
 imageTitle=Image Files
-imageFilter=*.jpg; *.jpeg; *.gif; *.png; *.bmp; *.xbm; *.ico
 xmlTitle=XML Files
 xmlFilter=*.xml
 xulTitle=XUL Files
 xulFilter=*.xul
 appsTitle=Applications
 
 dirTextInputLabel=Directory name:
 dirTextInputAccesskey=n
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -804,17 +804,16 @@ MAKEFILES_libpr0n="
   modules/libpr0n/decoders/png/Makefile
   modules/libpr0n/decoders/jpeg/Makefile
   modules/libpr0n/decoders/bmp/Makefile
   modules/libpr0n/decoders/icon/Makefile
   modules/libpr0n/decoders/icon/mac/Makefile
   modules/libpr0n/decoders/icon/win/Makefile
   modules/libpr0n/decoders/icon/gtk/Makefile
   modules/libpr0n/decoders/icon/beos/Makefile
-  modules/libpr0n/decoders/xbm/Makefile
   modules/libpr0n/encoders/Makefile
   modules/libpr0n/encoders/png/Makefile
   modules/libpr0n/encoders/jpeg/Makefile
 "
 
 MAKEFILES_accessible="
   accessible/Makefile
   accessible/public/Makefile
--- a/widget/src/xpwidgets/nsBaseFilePicker.cpp
+++ b/widget/src/xpwidgets/nsBaseFilePicker.cpp
@@ -148,18 +148,17 @@ nsBaseFilePicker::AppendFilters(PRInt32 
   }
   if (aFilterMask & filterText) {
     stringBundle->GetStringFromName(NS_LITERAL_STRING("textTitle").get(), getter_Copies(title));
     stringBundle->GetStringFromName(NS_LITERAL_STRING("textFilter").get(), getter_Copies(filter));
     AppendFilter(title,filter);
   }
   if (aFilterMask & filterImages) {
     stringBundle->GetStringFromName(NS_LITERAL_STRING("imageTitle").get(), getter_Copies(title));
-    stringBundle->GetStringFromName(NS_LITERAL_STRING("imageFilter").get(), getter_Copies(filter));
-    AppendFilter(title,filter);
+    AppendFilter(title,NS_LITERAL_STRING("*.jpg; *.jpeg; *.gif; *.png; *.bmp; *.ico"));
   }
   if (aFilterMask & filterXML) {
     stringBundle->GetStringFromName(NS_LITERAL_STRING("xmlTitle").get(), getter_Copies(title));
     stringBundle->GetStringFromName(NS_LITERAL_STRING("xmlFilter").get(), getter_Copies(filter));
     AppendFilter(title,filter);
   }
   if (aFilterMask & filterXUL) {
     stringBundle->GetStringFromName(NS_LITERAL_STRING("xulTitle").get(), getter_Copies(title));