зеркало из https://github.com/mozilla/pjs.git
Bug 513681 - part 4 - Get rid of CIDs and friends for decoders.r=joe,a=blocker
This commit is contained in:
Родитель
3222c22610
Коммит
e4de85b686
|
@ -93,8 +93,6 @@ GARBAGE += _img_list nsImgBuildDefines.h
|
|||
|
||||
export::
|
||||
{ \
|
||||
$(foreach d,$(filter-out icon,$(DECODERS)), \
|
||||
echo "#define IMG_BUILD_DECODER_${d}" ; ) \
|
||||
$(foreach d,$(MOZ_IMG_ENCODERS), \
|
||||
echo "#define IMG_BUILD_ENCODER_${d}" ; ) \
|
||||
} > nsImgBuildDefines.tmp
|
||||
|
|
|
@ -39,13 +39,6 @@
|
|||
|
||||
#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
|
||||
#endif
|
||||
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "mozilla/ModuleUtils.h"
|
||||
#include "nsXPCOMCID.h"
|
||||
|
@ -67,28 +60,6 @@
|
|||
#include "imgTools.h"
|
||||
#include "DiscardTracker.h"
|
||||
|
||||
#ifdef IMG_BUILD_DECODER_gif
|
||||
// gif
|
||||
#include "nsGIFDecoder2.h"
|
||||
#endif
|
||||
|
||||
#ifdef IMG_BUILD_DECODER_bmp
|
||||
// bmp/ico
|
||||
#include "nsBMPDecoder.h"
|
||||
#include "nsICODecoder.h"
|
||||
#include "nsIconDecoder.h"
|
||||
#endif
|
||||
|
||||
#ifdef IMG_BUILD_DECODER_png
|
||||
// png
|
||||
#include "nsPNGDecoder.h"
|
||||
#endif
|
||||
|
||||
#ifdef IMG_BUILD_DECODER_jpeg
|
||||
// jpeg
|
||||
#include "nsJPEGDecoder.h"
|
||||
#endif
|
||||
|
||||
#ifdef IMG_BUILD_ENCODER_png
|
||||
// png
|
||||
#include "nsPNGEncoder.h"
|
||||
|
@ -110,31 +81,11 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(imgLoader, Init)
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR(imgRequestProxy)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(imgTools)
|
||||
|
||||
#ifdef IMG_BUILD_DECODER_gif
|
||||
// gif
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsGIFDecoder2)
|
||||
#endif
|
||||
|
||||
#ifdef IMG_BUILD_DECODER_jpeg
|
||||
// jpeg
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsJPEGDecoder)
|
||||
#endif
|
||||
#ifdef IMG_BUILD_ENCODER_jpeg
|
||||
// jpeg
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsJPEGEncoder)
|
||||
#endif
|
||||
|
||||
#ifdef IMG_BUILD_DECODER_bmp
|
||||
// bmp
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsICODecoder)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBMPDecoder)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsIconDecoder)
|
||||
#endif
|
||||
|
||||
#ifdef IMG_BUILD_DECODER_png
|
||||
// png
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsPNGDecoder)
|
||||
#endif
|
||||
#ifdef IMG_BUILD_ENCODER_png
|
||||
// png
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsPNGEncoder)
|
||||
|
@ -144,23 +95,9 @@ NS_DEFINE_NAMED_CID(NS_IMGLOADER_CID);
|
|||
NS_DEFINE_NAMED_CID(NS_IMGREQUESTPROXY_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_IMGTOOLS_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_RASTERIMAGE_CID);
|
||||
#ifdef IMG_BUILD_DECODER_gif
|
||||
NS_DEFINE_NAMED_CID(NS_GIFDECODER2_CID);
|
||||
#endif
|
||||
#ifdef IMG_BUILD_DECODER_jpeg
|
||||
NS_DEFINE_NAMED_CID(NS_JPEGDECODER_CID);
|
||||
#endif
|
||||
#ifdef IMG_BUILD_ENCODER_jpeg
|
||||
NS_DEFINE_NAMED_CID(NS_JPEGENCODER_CID);
|
||||
#endif
|
||||
#ifdef IMG_BUILD_DECODER_bmp
|
||||
NS_DEFINE_NAMED_CID(NS_ICODECODER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_BMPDECODER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_ICONDECODER_CID);
|
||||
#endif
|
||||
#ifdef IMG_BUILD_DECODER_png
|
||||
NS_DEFINE_NAMED_CID(NS_PNGDECODER_CID);
|
||||
#endif
|
||||
#ifdef IMG_BUILD_ENCODER_png
|
||||
NS_DEFINE_NAMED_CID(NS_PNGENCODER_CID);
|
||||
#endif
|
||||
|
@ -171,23 +108,9 @@ static const mozilla::Module::CIDEntry kImageCIDs[] = {
|
|||
{ &kNS_IMGREQUESTPROXY_CID, false, NULL, imgRequestProxyConstructor, },
|
||||
{ &kNS_IMGTOOLS_CID, false, NULL, imgToolsConstructor, },
|
||||
{ &kNS_RASTERIMAGE_CID, false, NULL, RasterImageConstructor, },
|
||||
#ifdef IMG_BUILD_DECODER_gif
|
||||
{ &kNS_GIFDECODER2_CID, false, NULL, nsGIFDecoder2Constructor, },
|
||||
#endif
|
||||
#ifdef IMG_BUILD_DECODER_jpeg
|
||||
{ &kNS_JPEGDECODER_CID, false, NULL, nsJPEGDecoderConstructor, },
|
||||
#endif
|
||||
#ifdef IMG_BUILD_ENCODER_jpeg
|
||||
{ &kNS_JPEGENCODER_CID, false, NULL, nsJPEGEncoderConstructor, },
|
||||
#endif
|
||||
#ifdef IMG_BUILD_DECODER_bmp
|
||||
{ &kNS_ICODECODER_CID, false, NULL, nsICODecoderConstructor, },
|
||||
{ &kNS_BMPDECODER_CID, false, NULL, nsBMPDecoderConstructor, },
|
||||
{ &kNS_ICONDECODER_CID, false, NULL, nsIconDecoderConstructor, },
|
||||
#endif
|
||||
#ifdef IMG_BUILD_DECODER_png
|
||||
{ &kNS_PNGDECODER_CID, false, NULL, nsPNGDecoderConstructor, },
|
||||
#endif
|
||||
#ifdef IMG_BUILD_ENCODER_png
|
||||
{ &kNS_PNGENCODER_CID, false, NULL, nsPNGEncoderConstructor, },
|
||||
#endif
|
||||
|
@ -200,28 +123,9 @@ static const mozilla::Module::ContractIDEntry kImageContracts[] = {
|
|||
{ "@mozilla.org/image/request;1", &kNS_IMGREQUESTPROXY_CID },
|
||||
{ "@mozilla.org/image/tools;1", &kNS_IMGTOOLS_CID },
|
||||
{ "@mozilla.org/image/rasterimage;1", &kNS_RASTERIMAGE_CID },
|
||||
#ifdef IMG_BUILD_DECODER_gif
|
||||
{ "@mozilla.org/image/decoder;3?type=image/gif", &kNS_GIFDECODER2_CID },
|
||||
#endif
|
||||
#ifdef IMG_BUILD_DECODER_jpeg
|
||||
{ "@mozilla.org/image/decoder;3?type=image/jpeg", &kNS_JPEGDECODER_CID },
|
||||
{ "@mozilla.org/image/decoder;3?type=image/pjpeg", &kNS_JPEGDECODER_CID },
|
||||
{ "@mozilla.org/image/decoder;3?type=image/jpg", &kNS_JPEGDECODER_CID },
|
||||
#endif
|
||||
#ifdef IMG_BUILD_ENCODER_jpeg
|
||||
{ "@mozilla.org/image/encoder;2?type=image/jpeg", &kNS_JPEGENCODER_CID },
|
||||
#endif
|
||||
#ifdef IMG_BUILD_DECODER_bmp
|
||||
{ "@mozilla.org/image/decoder;3?type=image/x-icon", &kNS_ICODECODER_CID },
|
||||
{ "@mozilla.org/image/decoder;3?type=image/vnd.microsoft.icon", &kNS_ICODECODER_CID },
|
||||
{ "@mozilla.org/image/decoder;3?type=image/bmp", &kNS_BMPDECODER_CID },
|
||||
{ "@mozilla.org/image/decoder;3?type=image/x-ms-bmp", &kNS_BMPDECODER_CID },
|
||||
{ "@mozilla.org/image/decoder;3?type=image/icon", &kNS_ICONDECODER_CID },
|
||||
#endif
|
||||
#ifdef IMG_BUILD_DECODER_png
|
||||
{ "@mozilla.org/image/decoder;3?type=image/png", &kNS_PNGDECODER_CID },
|
||||
{ "@mozilla.org/image/decoder;3?type=image/x-png", &kNS_PNGDECODER_CID },
|
||||
#endif
|
||||
#ifdef IMG_BUILD_ENCODER_png
|
||||
{ "@mozilla.org/image/encoder;2?type=image/png", &kNS_PNGENCODER_CID },
|
||||
#endif
|
||||
|
@ -229,25 +133,17 @@ static const mozilla::Module::ContractIDEntry kImageContracts[] = {
|
|||
};
|
||||
|
||||
static const mozilla::Module::CategoryEntry kImageCategories[] = {
|
||||
#ifdef IMG_BUILD_DECODER_gif
|
||||
{ "Gecko-Content-Viewers", "image/gif", "@mozilla.org/content/document-loader-factory;1" },
|
||||
#endif
|
||||
#ifdef IMG_BUILD_DECODER_jpeg
|
||||
{ "Gecko-Content-Viewers", "image/jpeg", "@mozilla.org/content/document-loader-factory;1" },
|
||||
{ "Gecko-Content-Viewers", "image/pjpeg", "@mozilla.org/content/document-loader-factory;1" },
|
||||
{ "Gecko-Content-Viewers", "image/jpg", "@mozilla.org/content/document-loader-factory;1" },
|
||||
#endif
|
||||
#ifdef IMG_BUILD_DECODER_bmp
|
||||
{ "Gecko-Content-Viewers", "image/x-icon", "@mozilla.org/content/document-loader-factory;1" },
|
||||
{ "Gecko-Content-Viewers", "image/vnd.microsoft.icon", "@mozilla.org/content/document-loader-factory;1" },
|
||||
{ "Gecko-Content-Viewers", "image/bmp", "@mozilla.org/content/document-loader-factory;1" },
|
||||
{ "Gecko-Content-Viewers", "image/x-ms-bmp", "@mozilla.org/content/document-loader-factory;1" },
|
||||
{ "Gecko-Content-Viewers", "image/icon", "@mozilla.org/content/document-loader-factory;1" },
|
||||
#endif
|
||||
#ifdef IMG_BUILD_DECODER_png
|
||||
{ "Gecko-Content-Viewers", "image/png", "@mozilla.org/content/document-loader-factory;1" },
|
||||
{ "Gecko-Content-Viewers", "image/x-png", "@mozilla.org/content/document-loader-factory;1" },
|
||||
#endif
|
||||
{ "content-sniffing-services", "@mozilla.org/image/loader;1", "@mozilla.org/image/loader;1" },
|
||||
{ NULL }
|
||||
};
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
#include "nsBMPDecoder.h"
|
||||
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "RasterImage.h"
|
||||
#include "imgIContainerObserver.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
|
|
|
@ -45,14 +45,6 @@
|
|||
#include "imgIDecoderObserver.h"
|
||||
#include "gfxColor.h"
|
||||
|
||||
#define NS_BMPDECODER_CID \
|
||||
{ /* {78c61626-4d1f-4843-9364-4652d98ff6e1} */ \
|
||||
0x78c61626, \
|
||||
0x4d1f, \
|
||||
0x4843, \
|
||||
{ 0x93, 0x64, 0x46, 0x52, 0xd9, 0x8f, 0xf6, 0xe1 } \
|
||||
}
|
||||
|
||||
struct BMPFILEHEADER {
|
||||
char signature[2]; // String "BM"
|
||||
PRUint32 filesize;
|
||||
|
|
|
@ -50,9 +50,6 @@
|
|||
#include "RasterImage.h"
|
||||
#include "imgIContainerObserver.h"
|
||||
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
|
||||
#include "nsIProperties.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
|
||||
|
|
|
@ -47,10 +47,6 @@
|
|||
#include "imgIDecoderObserver.h"
|
||||
#include "nsBMPDecoder.h"
|
||||
|
||||
// {CB3EDE1A-0FA5-4e27-AAFE-0F7801E5A1F1}
|
||||
#define NS_ICODECODER_CID \
|
||||
{ 0xcb3ede1a, 0xfa5, 0x4e27, { 0xaa, 0xfe, 0xf, 0x78, 0x1, 0xe5, 0xa1, 0xf1 } }
|
||||
|
||||
namespace mozilla {
|
||||
namespace imagelib {
|
||||
class RasterImage;
|
||||
|
|
|
@ -43,11 +43,8 @@
|
|||
#include "RasterImage.h"
|
||||
#include "imgIContainerObserver.h"
|
||||
#include "nspr.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "ImageErrors.h"
|
||||
|
||||
using namespace mozilla::imagelib;
|
||||
|
|
|
@ -48,14 +48,6 @@
|
|||
#include "imgIContainer.h"
|
||||
#include "imgIDecoderObserver.h"
|
||||
|
||||
#define NS_ICONDECODER_CID \
|
||||
{ /* FFC08380-256C-11d5-9905-001083010E9B */ \
|
||||
0xffc08380, \
|
||||
0x256c, \
|
||||
0x11d5, \
|
||||
{ 0x99, 0x5, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b } \
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
namespace imagelib {
|
||||
class RasterImage;
|
||||
|
|
|
@ -75,11 +75,8 @@ mailing address.
|
|||
#include <stddef.h>
|
||||
#include "prmem.h"
|
||||
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
|
||||
#include "nsGIFDecoder2.h"
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "imgIContainerObserver.h"
|
||||
#include "RasterImage.h"
|
||||
|
||||
|
|
|
@ -48,14 +48,6 @@
|
|||
|
||||
#include "GIF2.h"
|
||||
|
||||
#define NS_GIFDECODER2_CID \
|
||||
{ /* 797bec5a-1dd2-11b2-a7f8-ca397e0179c4 */ \
|
||||
0x797bec5a, \
|
||||
0x1dd2, \
|
||||
0x11b2, \
|
||||
{0xa7, 0xf8, 0xca, 0x39, 0x7e, 0x01, 0x79, 0xc4} \
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
namespace imagelib {
|
||||
class RasterImage;
|
||||
|
|
|
@ -43,13 +43,11 @@
|
|||
|
||||
#include "imgIContainerObserver.h"
|
||||
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIInputStream.h"
|
||||
|
||||
#include "nspr.h"
|
||||
#include "nsCRT.h"
|
||||
#include "ImageLogging.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "gfxColor.h"
|
||||
|
||||
#include "jerror.h"
|
||||
|
|
|
@ -62,14 +62,6 @@ extern "C" {
|
|||
|
||||
#include <setjmp.h>
|
||||
|
||||
#define NS_JPEGDECODER_CID \
|
||||
{ /* 5871a422-1dd2-11b2-ab3f-e2e56be5da9c */ \
|
||||
0x5871a422, \
|
||||
0x1dd2, \
|
||||
0x11b2, \
|
||||
{0xab, 0x3f, 0xe2, 0xe5, 0x6b, 0xe5, 0xda, 0x9c} \
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_error_mgr pub; /* "public" fields for IJG library*/
|
||||
jmp_buf setjmp_buffer; /* For handling catastropic errors */
|
||||
|
|
|
@ -46,12 +46,10 @@
|
|||
#include "nsMemory.h"
|
||||
#include "nsRect.h"
|
||||
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIInputStream.h"
|
||||
|
||||
#include "RasterImage.h"
|
||||
#include "imgIContainerObserver.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
|
||||
#include "gfxColor.h"
|
||||
#include "nsColor.h"
|
||||
|
|
|
@ -53,14 +53,6 @@
|
|||
|
||||
#include "qcms.h"
|
||||
|
||||
#define NS_PNGDECODER_CID \
|
||||
{ /* 36fa00c2-1dd2-11b2-be07-d16eeb4c50ed */ \
|
||||
0x36fa00c2, \
|
||||
0x1dd2, \
|
||||
0x11b2, \
|
||||
{0xbe, 0x07, 0xd1, 0x6e, 0xeb, 0x4c, 0x50, 0xed} \
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
namespace imagelib {
|
||||
class RasterImage;
|
||||
|
|
Загрузка…
Ссылка в новой задаче