2018-11-30 15:39:55 +00:00
|
|
|
/* vim:set sw=2 sts=2 et cin: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2006-06-16 18:38:39 +00:00
|
|
|
|
|
|
|
#ifndef NSIMAGETOPIXBUF_H_
|
|
|
|
#define NSIMAGETOPIXBUF_H_
|
|
|
|
|
|
|
|
#include "nsIImageToPixbuf.h"
|
2012-07-26 19:17:33 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2006-06-16 18:38:39 +00:00
|
|
|
|
2014-01-23 11:33:23 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace gfx {
|
|
|
|
class SourceSurface;
|
|
|
|
}
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class nsImageToPixbuf final : public nsIImageToPixbuf {
|
2014-01-23 11:33:23 +00:00
|
|
|
typedef mozilla::gfx::SourceSurface SourceSurface;
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2006-06-16 18:38:39 +00:00
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
2015-03-21 16:28:04 +00:00
|
|
|
NS_IMETHOD_(GdkPixbuf*) ConvertImageToPixbuf(imgIContainer* aImage) override;
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2006-06-16 18:38:39 +00:00
|
|
|
// Friendlier version of ConvertImageToPixbuf for callers inside of
|
|
|
|
// widget
|
2010-12-07 13:54:50 +00:00
|
|
|
/**
|
|
|
|
* The return value of all these, if not null, should be
|
|
|
|
* released as needed by the caller using g_object_unref.
|
|
|
|
*/
|
Bug 753 - Remove nsIImage, gfxIImageFrame, and their implementations, and expose an equivalent api on imgIContainer. r=roc,josh,bz,longsonr,vlad,karlt,jimm,bsmedberg,mfinkle,peterw,peterv sr=vlad,roc
--HG--
rename : gfx/src/shared/gfxImageFrame.cpp => modules/libpr0n/src/imgFrame.cpp
rename : gfx/src/shared/gfxImageFrame.h => modules/libpr0n/src/imgFrame.h
2009-07-21 01:50:15 +00:00
|
|
|
static GdkPixbuf* ImageToPixbuf(imgIContainer* aImage);
|
2014-01-23 11:33:23 +00:00
|
|
|
static GdkPixbuf* SourceSurfaceToPixbuf(SourceSurface* aSurface,
|
|
|
|
int32_t aWidth, int32_t aHeight);
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2006-06-16 18:38:39 +00:00
|
|
|
private:
|
|
|
|
~nsImageToPixbuf() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
// fc2389b8-c650-4093-9e42-b05e5f0685b7
|
|
|
|
#define NS_IMAGE_TO_PIXBUF_CID \
|
2018-11-30 10:46:48 +00:00
|
|
|
{ \
|
2006-06-16 18:38:39 +00:00
|
|
|
0xfc2389b8, 0xc650, 0x4093, { \
|
|
|
|
0x9e, 0x42, 0xb0, 0x5e, 0x5f, 0x06, 0x85, 0xb7 \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|