зеркало из https://github.com/mozilla/gecko-dev.git
changing libpr0n filenames to img*
This commit is contained in:
Родитель
2920d555a0
Коммит
9bbc50ba30
|
@ -56,7 +56,7 @@ or revised. This service is offered free of charge; please provide us with your
|
|||
mailing address.
|
||||
*/
|
||||
|
||||
#include "nsIImageDecoder.h"
|
||||
#include "imgIDecoder.h"
|
||||
#include "prmem.h"
|
||||
#include "GIF2.h"
|
||||
#include "nsCRT.h"
|
||||
|
|
|
@ -36,9 +36,9 @@
|
|||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// GIF Decoder Implementation
|
||||
// This is an adaptor between GIF2 and nsIImageDecoder
|
||||
// This is an adaptor between GIF2 and imgIDecoder
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsGIFDecoder2, nsIImageDecoder, nsIOutputStream);
|
||||
NS_IMPL_ISUPPORTS2(nsGIFDecoder2, imgIDecoder, nsIOutputStream);
|
||||
|
||||
nsGIFDecoder2::nsGIFDecoder2()
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ nsGIFDecoder2::~nsGIFDecoder2(void)
|
|||
}
|
||||
|
||||
//******************************************************************************
|
||||
/** nsIImageDecoder methods **/
|
||||
/** imgIDecoder methods **/
|
||||
//******************************************************************************
|
||||
|
||||
//******************************************************************************
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
#define _nsGIFDecoder2_h
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIImageDecoder.h"
|
||||
#include "imgIDecoder.h"
|
||||
#include "gfxIImageContainer.h"
|
||||
#include "nsIImageDecoderObserver.h"
|
||||
#include "imgIDecoderObserver.h"
|
||||
#include "gfxIImageFrame.h"
|
||||
#include "imgIRequest.h"
|
||||
|
||||
|
@ -44,7 +44,7 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
// nsGIFDecoder2 Definition
|
||||
|
||||
class nsGIFDecoder2 : public nsIImageDecoder
|
||||
class nsGIFDecoder2 : public imgIDecoder
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -61,7 +61,7 @@ public:
|
|||
nsCOMPtr<gfxIImageContainer> mImageContainer;
|
||||
nsCOMPtr<gfxIImageFrame> mImageFrame;
|
||||
nsCOMPtr<imgIRequest> mImageRequest;
|
||||
nsCOMPtr<nsIImageDecoderObserver> mObserver; // this is just qi'd from mRequest for speed
|
||||
nsCOMPtr<imgIDecoderObserver> mObserver; // this is just qi'd from mRequest for speed
|
||||
|
||||
gif_struct mGIFStruct;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
#include "gfxIImageContainerObserver.h"
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsJPEGDecoder, nsIImageDecoder, nsIOutputStream)
|
||||
NS_IMPL_ISUPPORTS2(nsJPEGDecoder, imgIDecoder, nsIOutputStream)
|
||||
|
||||
|
||||
void PR_CALLBACK init_source (j_decompress_ptr jd);
|
||||
|
@ -78,7 +78,7 @@ nsJPEGDecoder::~nsJPEGDecoder()
|
|||
}
|
||||
|
||||
|
||||
/** nsIImageDecoder methods **/
|
||||
/** imgIDecoder methods **/
|
||||
|
||||
/* void init (in imgIRequest aRequest); */
|
||||
NS_IMETHODIMP nsJPEGDecoder::Init(imgIRequest *aRequest)
|
||||
|
|
|
@ -24,13 +24,13 @@
|
|||
#ifndef nsJPEGDecoder_h__
|
||||
#define nsJPEGDecoder_h__
|
||||
|
||||
#include "nsIImageDecoder.h"
|
||||
#include "imgIDecoder.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
#include "gfxIImageContainer.h"
|
||||
#include "gfxIImageFrame.h"
|
||||
#include "nsIImageDecoderObserver.h"
|
||||
#include "imgIDecoderObserver.h"
|
||||
#include "imgIRequest.h"
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsIPipe.h"
|
||||
|
@ -65,7 +65,7 @@ typedef enum {
|
|||
JPEG_ERROR
|
||||
} jstate;
|
||||
|
||||
class nsJPEGDecoder : public nsIImageDecoder
|
||||
class nsJPEGDecoder : public imgIDecoder
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
nsCOMPtr<gfxIImageFrame> mFrame;
|
||||
nsCOMPtr<imgIRequest> mRequest;
|
||||
|
||||
nsCOMPtr<nsIImageDecoderObserver> mObserver;
|
||||
nsCOMPtr<imgIDecoderObserver> mObserver;
|
||||
|
||||
struct jpeg_decompress_struct mInfo;
|
||||
decoder_error_mgr mErr;
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
// XXX we need to be sure to fire onStopDecode messages to mObserver in error cases.
|
||||
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsPNGDecoder, nsIImageDecoder, nsIOutputStream)
|
||||
NS_IMPL_ISUPPORTS2(nsPNGDecoder, imgIDecoder, nsIOutputStream)
|
||||
|
||||
|
||||
nsPNGDecoder::nsPNGDecoder()
|
||||
|
@ -68,7 +68,7 @@ nsPNGDecoder::~nsPNGDecoder()
|
|||
}
|
||||
|
||||
|
||||
/** nsIImageDecoder methods **/
|
||||
/** imgIDecoder methods **/
|
||||
|
||||
/* void init (in imgIRequest aRequest); */
|
||||
NS_IMETHODIMP nsPNGDecoder::Init(imgIRequest *aRequest)
|
||||
|
|
|
@ -24,10 +24,10 @@
|
|||
#ifndef nsPNGDecoder_h__
|
||||
#define nsPNGDecoder_h__
|
||||
|
||||
#include "nsIImageDecoder.h"
|
||||
#include "imgIDecoder.h"
|
||||
|
||||
#include "gfxIImageContainer.h"
|
||||
#include "nsIImageDecoderObserver.h"
|
||||
#include "imgIDecoderObserver.h"
|
||||
#include "gfxIImageFrame.h"
|
||||
#include "imgIRequest.h"
|
||||
|
||||
|
@ -44,7 +44,7 @@
|
|||
{0xbe, 0x07, 0xd1, 0x6e, 0xeb, 0x4c, 0x50, 0xed} \
|
||||
}
|
||||
|
||||
class nsPNGDecoder : public nsIImageDecoder
|
||||
class nsPNGDecoder : public imgIDecoder
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -70,7 +70,7 @@ public:
|
|||
nsCOMPtr<gfxIImageContainer> mImage;
|
||||
nsCOMPtr<gfxIImageFrame> mFrame;
|
||||
nsCOMPtr<imgIRequest> mRequest;
|
||||
nsCOMPtr<nsIImageDecoderObserver> mObserver; // this is just qi'd from mRequest for speed
|
||||
nsCOMPtr<imgIDecoderObserver> mObserver; // this is just qi'd from mRequest for speed
|
||||
|
||||
png_structp mPNG;
|
||||
png_infop mInfo;
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
#include "nsRect.h"
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsPPMDecoder, nsIImageDecoder, nsIOutputStream)
|
||||
NS_IMPL_ISUPPORTS2(nsPPMDecoder, imgIDecoder, nsIOutputStream)
|
||||
|
||||
|
||||
nsPPMDecoder::nsPPMDecoder()
|
||||
|
@ -53,7 +53,7 @@ nsPPMDecoder::~nsPPMDecoder()
|
|||
}
|
||||
|
||||
|
||||
/** nsIImageDecoder methods **/
|
||||
/** imgIDecoder methods **/
|
||||
|
||||
/* void init (in imgIRequest aRequest); */
|
||||
NS_IMETHODIMP nsPPMDecoder::Init(imgIRequest *aRequest)
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
#ifndef nsPPMDecoder_h__
|
||||
#define nsPPMDecoder_h__
|
||||
|
||||
#include "nsIImageDecoder.h"
|
||||
#include "imgIDecoder.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
#include "gfxIImageContainer.h"
|
||||
#include "nsIImageDecoderObserver.h"
|
||||
#include "imgIDecoderObserver.h"
|
||||
#include "gfxIImageFrame.h"
|
||||
#include "imgIRequest.h"
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
|||
{0x82, 0x17, 0xf3, 0x8f, 0xe5, 0xd4, 0x31, 0xa2} \
|
||||
}
|
||||
|
||||
class nsPPMDecoder : public nsIImageDecoder
|
||||
class nsPPMDecoder : public imgIDecoder
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -55,7 +55,7 @@ private:
|
|||
nsCOMPtr<gfxIImageContainer> mImage;
|
||||
nsCOMPtr<gfxIImageFrame> mFrame;
|
||||
nsCOMPtr<imgIRequest> mRequest;
|
||||
nsCOMPtr<nsIImageDecoderObserver> mObserver; // this is just qi'd from mRequest for speed
|
||||
nsCOMPtr<imgIDecoderObserver> mObserver; // this is just qi'd from mRequest for speed
|
||||
|
||||
PRUint32 mDataReceived;
|
||||
PRUint32 mDataWritten;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
nsIImageDecoder.idl
|
||||
nsIImageDecoderObserver.idl
|
||||
nsIImageLoader.idl
|
||||
imgIDecoder.idl
|
||||
imgIDecoderObserver.idl
|
||||
imgILoader.idl
|
||||
imgIRequest.idl
|
||||
|
|
|
@ -28,10 +28,10 @@ include $(DEPTH)/config/autoconf.mk
|
|||
|
||||
MODULE = imglib2
|
||||
|
||||
XPIDLSRCS = nsIImageDecoder.idl \
|
||||
nsIImageDecoderObserver.idl \
|
||||
nsIImageLoader.idl \
|
||||
imgIRequest.idl
|
||||
XPIDLSRCS = imgIDecoder.idl \
|
||||
imgIDecoderObserver.idl \
|
||||
imgILoader.idl \
|
||||
imgIRequest.idl
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
|
|
@ -28,23 +28,23 @@
|
|||
interface imgIRequest;
|
||||
|
||||
/**
|
||||
* nsIImageDecoder interface
|
||||
* imgIDecoder interface
|
||||
*
|
||||
* @author Stuart Parmenter <pavlov@netscape.com>
|
||||
* @version 0.1
|
||||
* @see imagelib2
|
||||
*/
|
||||
[scriptable, uuid(9eebf43a-1dd1-11b2-953e-f1782f4cbad3)]
|
||||
interface nsIImageDecoder : nsIOutputStream
|
||||
interface imgIDecoder : nsIOutputStream
|
||||
{
|
||||
/**
|
||||
* Initalize an image decoder.
|
||||
* @param aRequest the request that owns the decoder.
|
||||
*
|
||||
* @note The decode should QI \a aRequest to an nsIImageDecoderObserver
|
||||
* @note The decode should QI \a aRequest to an imgIDecoderObserver
|
||||
* and should send decoder notifications to the request.
|
||||
* The decoder should always pass NULL as the first two parameters to
|
||||
* all of the nsIImageDecoderObserver APIs.
|
||||
* all of the imgIDecoderObserver APIs.
|
||||
*/
|
||||
void init(in imgIRequest aRequest);
|
||||
|
|
@ -33,14 +33,14 @@ interface gfxIImageFrame;
|
|||
%}
|
||||
|
||||
/**
|
||||
* nsIImageDecoderObserver interface
|
||||
* imgIDecoderObserver interface
|
||||
*
|
||||
* @author Stuart Parmenter <pavlov@netscape.com>
|
||||
* @version 0.1
|
||||
* @see imagelib2
|
||||
*/
|
||||
[scriptable, uuid(350163d2-1dd2-11b2-9e69-89959ecec1f3)]
|
||||
interface nsIImageDecoderObserver : gfxIImageContainerObserver
|
||||
interface imgIDecoderObserver : gfxIImageContainerObserver
|
||||
{
|
||||
/**
|
||||
* called as soon as the image begins getting decoded
|
|
@ -24,7 +24,7 @@
|
|||
#include "nsISupports.idl"
|
||||
#include "gfxtypes.idl"
|
||||
|
||||
interface nsIImageDecoderObserver;
|
||||
interface imgIDecoderObserver;
|
||||
interface imgIRequest;
|
||||
interface nsISimpleEnumerator;
|
||||
interface nsIStreamListener;
|
||||
|
@ -32,14 +32,14 @@ interface nsIURI;
|
|||
interface nsIChannel;
|
||||
|
||||
/**
|
||||
* nsIImageLoader interface
|
||||
* imgILoader interface
|
||||
*
|
||||
* @author Stuart Parmenter <pavlov@netscape.com>
|
||||
* @version 0.1
|
||||
* @see imagelib2
|
||||
*/
|
||||
[scriptable, uuid(4c8cf1e0-1dd2-11b2-aff9-c51cdbfcb6da)]
|
||||
interface nsIImageLoader : nsISupports
|
||||
interface imgILoader : nsISupports
|
||||
{
|
||||
/**
|
||||
* Start the load and decode of an image.
|
||||
|
@ -47,7 +47,7 @@ interface nsIImageLoader : nsISupports
|
|||
* @param aObserver the observer
|
||||
* @param cx some random data
|
||||
*/
|
||||
imgIRequest loadImage(in nsIURI uri, in nsIImageDecoderObserver aObserver, in nsISupports cx);
|
||||
imgIRequest loadImage(in nsIURI uri, in imgIDecoderObserver aObserver, in nsISupports cx);
|
||||
|
||||
/**
|
||||
* Start the load and decode of an image.
|
||||
|
@ -55,7 +55,7 @@ interface nsIImageLoader : nsISupports
|
|||
* @param aObserver the observer
|
||||
* @param cx some random data
|
||||
*/
|
||||
imgIRequest loadImageWithChannel(in nsIChannel aChannel, in nsIImageDecoderObserver aObserver, in nsISupports cx, out nsIStreamListener aListener);
|
||||
imgIRequest loadImageWithChannel(in nsIChannel aChannel, in imgIDecoderObserver aObserver, in nsISupports cx, out nsIStreamListener aListener);
|
||||
|
||||
/**
|
||||
* Returns the channels contained directly in this group.
|
|
@ -28,9 +28,9 @@ MODULE = imglib2
|
|||
XPIDL_MODULE = imglib2
|
||||
|
||||
XPIDLSRCS = \
|
||||
.\nsIImageDecoder.idl \
|
||||
.\nsIImageDecoderObserver.idl \
|
||||
.\nsIImageLoader.idl \
|
||||
.\imgIDecoder.idl \
|
||||
.\imgIDecoderObserver.idl \
|
||||
.\imgILoader.idl \
|
||||
.\imgIRequest.idl \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -24,22 +24,22 @@
|
|||
#include "nsIGenericFactory.h"
|
||||
#include "nsIModule.h"
|
||||
|
||||
#include "nsImageLoader.h"
|
||||
#include "imgLoader.h"
|
||||
#include "imgRequest.h"
|
||||
#include "imgRequestProxy.h"
|
||||
|
||||
// objects that just require generic constructors
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsImageLoader)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(imgLoader)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(imgRequest)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(imgRequestProxy)
|
||||
|
||||
static nsModuleComponentInfo components[] =
|
||||
{
|
||||
{ "image loader",
|
||||
NS_IMAGELOADER_CID,
|
||||
NS_IMGLOADER_CID,
|
||||
"@mozilla.org/image/loader;1",
|
||||
nsImageLoaderConstructor, },
|
||||
imgLoaderConstructor, },
|
||||
{ "image request",
|
||||
NS_IMGREQUEST_CID,
|
||||
"@mozilla.org/image/request/real;1",
|
|
@ -31,8 +31,8 @@ LIBRARY_NAME = imglib2
|
|||
IS_COMPONENT = 1
|
||||
|
||||
CPPSRCS = ImageCache.cpp \
|
||||
nsImageFactory.cpp \
|
||||
nsImageLoader.cpp \
|
||||
ImageFactory.cpp \
|
||||
imgLoader.cpp \
|
||||
imgRequest.cpp \
|
||||
imgRequestProxy.cpp
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* Stuart Parmenter <pavlov@netscape.com>
|
||||
*/
|
||||
|
||||
#include "nsImageLoader.h"
|
||||
#include "imgLoader.h"
|
||||
|
||||
#include "imgIRequest.h"
|
||||
|
||||
|
@ -50,12 +50,12 @@ static NS_DEFINE_CID(kImageRequestCID, NS_IMGREQUEST_CID);
|
|||
static NS_DEFINE_CID(kImageRequestProxyCID, NS_IMGREQUESTPROXY_CID);
|
||||
|
||||
#ifdef LOADER_THREADSAFE
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsImageLoader, nsIImageLoader)
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS1(imgLoader, imgILoader)
|
||||
#else
|
||||
NS_IMPL_ISUPPORTS1(nsImageLoader, nsIImageLoader)
|
||||
NS_IMPL_ISUPPORTS1(imgLoader, imgILoader)
|
||||
#endif
|
||||
|
||||
nsImageLoader::nsImageLoader()
|
||||
imgLoader::imgLoader()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
/* member initializers and constructor code */
|
||||
|
@ -64,7 +64,7 @@ nsImageLoader::nsImageLoader()
|
|||
#endif
|
||||
}
|
||||
|
||||
nsImageLoader::~nsImageLoader()
|
||||
imgLoader::~imgLoader()
|
||||
{
|
||||
/* destructor code */
|
||||
#ifdef LOADER_THREADSAFE
|
||||
|
@ -72,10 +72,10 @@ nsImageLoader::~nsImageLoader()
|
|||
#endif
|
||||
}
|
||||
|
||||
/* imgIRequest loadImage (in nsIURI uri, in nsIImageDecoderObserver aObserver, in nsISupports cx); */
|
||||
NS_IMETHODIMP nsImageLoader::LoadImage(nsIURI *aURI, nsIImageDecoderObserver *aObserver, nsISupports *cx, imgIRequest **_retval)
|
||||
/* imgIRequest loadImage (in nsIURI uri, in imgIDecoderObserver aObserver, in nsISupports cx); */
|
||||
NS_IMETHODIMP imgLoader::LoadImage(nsIURI *aURI, imgIDecoderObserver *aObserver, nsISupports *cx, imgIRequest **_retval)
|
||||
{
|
||||
NS_ASSERTION(aURI, "nsImageLoader::LoadImage -- NULL URI pointer");
|
||||
NS_ASSERTION(aURI, "imgLoader::LoadImage -- NULL URI pointer");
|
||||
|
||||
imgRequest *request = nsnull;
|
||||
|
||||
|
@ -117,10 +117,10 @@ NS_IMETHODIMP nsImageLoader::LoadImage(nsIURI *aURI, nsIImageDecoderObserver *aO
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* imgIRequest loadImageWithChannel(in nsIChannel, in nsIImageDecoderObserver aObserver, in nsISupports cx, out nsIStreamListener); */
|
||||
NS_IMETHODIMP nsImageLoader::LoadImageWithChannel(nsIChannel *channel, nsIImageDecoderObserver *aObserver, nsISupports *cx, nsIStreamListener **listener, imgIRequest **_retval)
|
||||
/* imgIRequest loadImageWithChannel(in nsIChannel, in imgIDecoderObserver aObserver, in nsISupports cx, out nsIStreamListener); */
|
||||
NS_IMETHODIMP imgLoader::LoadImageWithChannel(nsIChannel *channel, imgIDecoderObserver *aObserver, nsISupports *cx, nsIStreamListener **listener, imgIRequest **_retval)
|
||||
{
|
||||
NS_ASSERTION(channel, "nsImageLoader::LoadImageWithChannel -- NULL channel pointer");
|
||||
NS_ASSERTION(channel, "imgLoader::LoadImageWithChannel -- NULL channel pointer");
|
||||
|
||||
imgRequest *request = nsnull;
|
||||
|
||||
|
@ -169,7 +169,7 @@ NS_IMETHODIMP nsImageLoader::LoadImageWithChannel(nsIChannel *channel, nsIImageD
|
|||
}
|
||||
|
||||
/* readonly attribute nsISimpleEnumerator requests; */
|
||||
NS_IMETHODIMP nsImageLoader::GetRequests(nsISimpleEnumerator * *aRequests)
|
||||
NS_IMETHODIMP imgLoader::GetRequests(nsISimpleEnumerator * *aRequests)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
|
@ -23,13 +23,13 @@
|
|||
|
||||
//#define LOADER_THREADSAFE 1
|
||||
|
||||
#include "nsIImageLoader.h"
|
||||
#include "imgILoader.h"
|
||||
|
||||
#ifdef LOADER_THREADSAFE
|
||||
#include "prlock.h"
|
||||
#endif
|
||||
|
||||
#define NS_IMAGELOADER_CID \
|
||||
#define NS_IMGLOADER_CID \
|
||||
{ /* 9f6a0d2e-1dd1-11b2-a5b8-951f13c846f7 */ \
|
||||
0x9f6a0d2e, \
|
||||
0x1dd1, \
|
||||
|
@ -37,14 +37,14 @@
|
|||
{0xa5, 0xb8, 0x95, 0x1f, 0x13, 0xc8, 0x46, 0xf7} \
|
||||
}
|
||||
|
||||
class nsImageLoader : public nsIImageLoader
|
||||
class imgLoader : public imgILoader
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIIMAGELOADER
|
||||
|
||||
nsImageLoader();
|
||||
virtual ~nsImageLoader();
|
||||
imgLoader();
|
||||
virtual ~imgLoader();
|
||||
|
||||
private:
|
||||
#ifdef LOADER_THREADSAFE
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "nsIChannel.h"
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsIImageLoader.h"
|
||||
#include "imgILoader.h"
|
||||
#include "nsIComponentManager.h"
|
||||
|
||||
#include "nsIComponentManager.h"
|
||||
|
@ -39,7 +39,7 @@
|
|||
|
||||
|
||||
NS_IMPL_ISUPPORTS5(imgRequest, imgIRequest,
|
||||
nsIImageDecoderObserver, gfxIImageContainerObserver,
|
||||
imgIDecoderObserver, gfxIImageContainerObserver,
|
||||
nsIStreamListener, nsIStreamObserver)
|
||||
|
||||
imgRequest::imgRequest() :
|
||||
|
@ -70,7 +70,7 @@ nsresult imgRequest::Init(nsIChannel *aChannel)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult imgRequest::AddObserver(nsIImageDecoderObserver *observer)
|
||||
nsresult imgRequest::AddObserver(imgIDecoderObserver *observer)
|
||||
{
|
||||
mObservers.AppendElement(NS_STATIC_CAST(void*, observer));
|
||||
|
||||
|
@ -89,7 +89,7 @@ nsresult imgRequest::AddObserver(nsIImageDecoderObserver *observer)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult imgRequest::RemoveObserver(nsIImageDecoderObserver *observer, nsresult status)
|
||||
nsresult imgRequest::RemoveObserver(imgIDecoderObserver *observer, nsresult status)
|
||||
{
|
||||
mObservers.RemoveElement(NS_STATIC_CAST(void*, observer));
|
||||
|
||||
|
@ -116,7 +116,7 @@ NS_IMETHODIMP imgRequest::Cancel(nsresult status)
|
|||
return rv;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIImage image; */
|
||||
/* readonly attribute gfxIImageContainer image; */
|
||||
NS_IMETHODIMP imgRequest::GetImage(gfxIImageContainer * *aImage)
|
||||
{
|
||||
*aImage = mImage;
|
||||
|
@ -143,14 +143,14 @@ NS_IMETHODIMP imgRequest::FrameChanged(gfxIImageContainer *container, nsISupport
|
|||
PRInt32 count = mObservers.Count();
|
||||
|
||||
while (++i < count) {
|
||||
nsIImageDecoderObserver *ob = NS_STATIC_CAST(nsIImageDecoderObserver*, mObservers[i]);
|
||||
imgIDecoderObserver *ob = NS_STATIC_CAST(imgIDecoderObserver*, mObservers[i]);
|
||||
if (ob) ob->FrameChanged(container, cx, newframe, dirtyRect);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/** nsIImageDecoderObserver methods **/
|
||||
/** imgIDecoderObserver methods **/
|
||||
|
||||
/* void onStartDecode (in imgIRequest request, in nsISupports cx); */
|
||||
NS_IMETHODIMP imgRequest::OnStartDecode(imgIRequest *request, nsISupports *cx)
|
||||
|
@ -161,7 +161,7 @@ NS_IMETHODIMP imgRequest::OnStartDecode(imgIRequest *request, nsISupports *cx)
|
|||
PRInt32 count = mObservers.Count();
|
||||
|
||||
while (++i < count) {
|
||||
nsIImageDecoderObserver *ob = NS_STATIC_CAST(nsIImageDecoderObserver*, mObservers[i]);
|
||||
imgIDecoderObserver *ob = NS_STATIC_CAST(imgIDecoderObserver*, mObservers[i]);
|
||||
if (ob) ob->OnStartDecode(request, cx);
|
||||
}
|
||||
|
||||
|
@ -179,7 +179,7 @@ NS_IMETHODIMP imgRequest::OnStartContainer(imgIRequest *request, nsISupports *cx
|
|||
PRInt32 count = mObservers.Count();
|
||||
|
||||
while (++i < count) {
|
||||
nsIImageDecoderObserver *ob = NS_STATIC_CAST(nsIImageDecoderObserver*, mObservers[i]);
|
||||
imgIDecoderObserver *ob = NS_STATIC_CAST(imgIDecoderObserver*, mObservers[i]);
|
||||
if (ob) ob->OnStartContainer(request, cx, image);
|
||||
}
|
||||
|
||||
|
@ -193,7 +193,7 @@ NS_IMETHODIMP imgRequest::OnStartFrame(imgIRequest *request, nsISupports *cx, gf
|
|||
PRInt32 count = mObservers.Count();
|
||||
|
||||
while (++i < count) {
|
||||
nsIImageDecoderObserver *ob = NS_STATIC_CAST(nsIImageDecoderObserver*, mObservers[i]);
|
||||
imgIDecoderObserver *ob = NS_STATIC_CAST(imgIDecoderObserver*, mObservers[i]);
|
||||
if (ob) ob->OnStartFrame(request, cx, frame);
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ NS_IMETHODIMP imgRequest::OnDataAvailable(imgIRequest *request, nsISupports *cx,
|
|||
PRInt32 count = mObservers.Count();
|
||||
|
||||
while (++i < count) {
|
||||
nsIImageDecoderObserver *ob = NS_STATIC_CAST(nsIImageDecoderObserver*, mObservers[i]);
|
||||
imgIDecoderObserver *ob = NS_STATIC_CAST(imgIDecoderObserver*, mObservers[i]);
|
||||
if (ob) ob->OnDataAvailable(request, cx, frame, rect);
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,7 @@ NS_IMETHODIMP imgRequest::OnStopFrame(imgIRequest *request, nsISupports *cx, gfx
|
|||
PRInt32 count = mObservers.Count();
|
||||
|
||||
while (++i < count) {
|
||||
nsIImageDecoderObserver *ob = NS_STATIC_CAST(nsIImageDecoderObserver*, mObservers[i]);
|
||||
imgIDecoderObserver *ob = NS_STATIC_CAST(imgIDecoderObserver*, mObservers[i]);
|
||||
if (ob) ob->OnStopFrame(request, cx, frame);
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ NS_IMETHODIMP imgRequest::OnStopContainer(imgIRequest *request, nsISupports *cx,
|
|||
PRInt32 count = mObservers.Count();
|
||||
|
||||
while (++i < count) {
|
||||
nsIImageDecoderObserver *ob = NS_STATIC_CAST(nsIImageDecoderObserver*, mObservers[i]);
|
||||
imgIDecoderObserver *ob = NS_STATIC_CAST(imgIDecoderObserver*, mObservers[i]);
|
||||
if (ob) ob->OnStopContainer(request, cx, image);
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,7 @@ NS_IMETHODIMP imgRequest::OnStopDecode(imgIRequest *request, nsISupports *cx, ns
|
|||
PRInt32 count = mObservers.Count();
|
||||
|
||||
while (++i < count) {
|
||||
nsIImageDecoderObserver *ob = NS_STATIC_CAST(nsIImageDecoderObserver*, mObservers[i]);
|
||||
imgIDecoderObserver *ob = NS_STATIC_CAST(imgIDecoderObserver*, mObservers[i]);
|
||||
if (ob) ob->OnStopDecode(request, cx, status, statusArg);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
|
||||
#include "nsIChannel.h"
|
||||
#include "gfxIImageContainer.h"
|
||||
#include "nsIImageDecoder.h"
|
||||
#include "nsIImageDecoderObserver.h"
|
||||
#include "imgIDecoder.h"
|
||||
#include "imgIDecoderObserver.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
|
@ -54,7 +54,7 @@ enum {
|
|||
};
|
||||
|
||||
class imgRequest : public imgIRequest,
|
||||
public nsIImageDecoderObserver,
|
||||
public imgIDecoderObserver,
|
||||
public nsIStreamListener
|
||||
{
|
||||
public:
|
||||
|
@ -63,8 +63,8 @@ public:
|
|||
|
||||
/* additional members */
|
||||
nsresult Init(nsIChannel *aChannel);
|
||||
nsresult AddObserver(nsIImageDecoderObserver *observer);
|
||||
nsresult RemoveObserver(nsIImageDecoderObserver *observer, nsresult status);
|
||||
nsresult AddObserver(imgIDecoderObserver *observer);
|
||||
nsresult RemoveObserver(imgIDecoderObserver *observer, nsresult status);
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_IMGIREQUEST
|
||||
|
@ -76,7 +76,7 @@ public:
|
|||
private:
|
||||
nsCOMPtr<nsIChannel> mChannel;
|
||||
nsCOMPtr<gfxIImageContainer> mImage;
|
||||
nsCOMPtr<nsIImageDecoder> mDecoder;
|
||||
nsCOMPtr<imgIDecoder> mDecoder;
|
||||
|
||||
nsVoidArray mObservers;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "nsXPIDLString.h"
|
||||
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsIImageLoader.h"
|
||||
#include "imgILoader.h"
|
||||
#include "nsIComponentManager.h"
|
||||
|
||||
#include "nsIComponentManager.h"
|
||||
|
@ -40,7 +40,7 @@
|
|||
|
||||
#include "nspr.h"
|
||||
|
||||
NS_IMPL_ISUPPORTS3(imgRequestProxy, imgIRequest, nsIImageDecoderObserver, gfxIImageContainerObserver)
|
||||
NS_IMPL_ISUPPORTS3(imgRequestProxy, imgIRequest, imgIDecoderObserver, gfxIImageContainerObserver)
|
||||
|
||||
imgRequestProxy::imgRequestProxy()
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ imgRequestProxy::~imgRequestProxy()
|
|||
|
||||
|
||||
|
||||
nsresult imgRequestProxy::Init(imgRequest *request, nsIImageDecoderObserver *aObserver, nsISupports *cx)
|
||||
nsresult imgRequestProxy::Init(imgRequest *request, imgIDecoderObserver *aObserver, nsISupports *cx)
|
||||
{
|
||||
PR_ASSERT(request);
|
||||
|
||||
|
@ -79,7 +79,7 @@ NS_IMETHODIMP imgRequestProxy::Cancel(nsresult status)
|
|||
return NS_REINTERPRET_CAST(imgRequest*, mOwner.get())->RemoveObserver(this, status);
|
||||
}
|
||||
|
||||
/* readonly attribute nsIImage image; */
|
||||
/* readonly attribute gfxIImageContainer image; */
|
||||
NS_IMETHODIMP imgRequestProxy::GetImage(gfxIImageContainer * *aImage)
|
||||
{
|
||||
return mOwner->GetImage(aImage);
|
||||
|
@ -104,7 +104,7 @@ NS_IMETHODIMP imgRequestProxy::FrameChanged(gfxIImageContainer *container, nsISu
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/** nsIImageDecoderObserver methods **/
|
||||
/** imgIDecoderObserver methods **/
|
||||
|
||||
/* void onStartDecode (in imgIRequest request, in nsISupports cx); */
|
||||
NS_IMETHODIMP imgRequestProxy::OnStartDecode(imgIRequest *request, nsISupports *cx)
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
*/
|
||||
|
||||
#include "imgRequest.h"
|
||||
#include "nsIImageDecoderObserver.h"
|
||||
#include "imgIDecoderObserver.h"
|
||||
|
||||
#include "gfxIImageContainer.h"
|
||||
#include "nsIImageDecoder.h"
|
||||
#include "imgIDecoder.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
#define NS_IMGREQUESTPROXY_CID \
|
||||
|
@ -37,7 +37,7 @@
|
|||
}
|
||||
|
||||
class imgRequestProxy : public imgIRequest,
|
||||
public nsIImageDecoderObserver
|
||||
public imgIDecoderObserver
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -49,10 +49,10 @@ public:
|
|||
virtual ~imgRequestProxy();
|
||||
|
||||
/* additional members */
|
||||
nsresult Init(imgRequest *request, nsIImageDecoderObserver *aObserver, nsISupports *cx);
|
||||
nsresult Init(imgRequest *request, imgIDecoderObserver *aObserver, nsISupports *cx);
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIImageDecoderObserver> mObserver;
|
||||
nsCOMPtr<imgIDecoderObserver> mObserver;
|
||||
|
||||
nsCOMPtr<nsISupports> mContext;
|
||||
|
||||
|
|
|
@ -31,10 +31,10 @@ MAKE_OBJ_TYPE = DLL
|
|||
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\ImageCache.obj \
|
||||
.\$(OBJDIR)\nsImageLoader.obj \
|
||||
.\$(OBJDIR)\imgLoader.obj \
|
||||
.\$(OBJDIR)\imgRequest.obj \
|
||||
.\$(OBJDIR)\imgRequestProxy.obj \
|
||||
.\$(OBJDIR)\nsImageFactory.obj \
|
||||
.\$(OBJDIR)\ImageFactory.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS=\
|
||||
|
|
Загрузка…
Ссылка в новой задаче