Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* vim:set sw=4 sts=4 et cin: */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef NSIMAGETOPIXBUF_H_ |
michael@0 | 7 | #define NSIMAGETOPIXBUF_H_ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsIImageToPixbuf.h" |
michael@0 | 10 | #include "mozilla/Attributes.h" |
michael@0 | 11 | |
michael@0 | 12 | namespace mozilla { |
michael@0 | 13 | namespace gfx { |
michael@0 | 14 | class SourceSurface; |
michael@0 | 15 | } |
michael@0 | 16 | } |
michael@0 | 17 | |
michael@0 | 18 | class nsImageToPixbuf MOZ_FINAL : public nsIImageToPixbuf { |
michael@0 | 19 | typedef mozilla::gfx::SourceSurface SourceSurface; |
michael@0 | 20 | |
michael@0 | 21 | public: |
michael@0 | 22 | NS_DECL_ISUPPORTS |
michael@0 | 23 | NS_IMETHOD_(GdkPixbuf*) ConvertImageToPixbuf(imgIContainer* aImage); |
michael@0 | 24 | |
michael@0 | 25 | // Friendlier version of ConvertImageToPixbuf for callers inside of |
michael@0 | 26 | // widget |
michael@0 | 27 | /** |
michael@0 | 28 | * The return value of all these, if not null, should be |
michael@0 | 29 | * released as needed by the caller using g_object_unref. |
michael@0 | 30 | */ |
michael@0 | 31 | static GdkPixbuf* ImageToPixbuf(imgIContainer * aImage); |
michael@0 | 32 | static GdkPixbuf* SourceSurfaceToPixbuf(SourceSurface* aSurface, |
michael@0 | 33 | int32_t aWidth, |
michael@0 | 34 | int32_t aHeight); |
michael@0 | 35 | |
michael@0 | 36 | private: |
michael@0 | 37 | ~nsImageToPixbuf() {} |
michael@0 | 38 | }; |
michael@0 | 39 | |
michael@0 | 40 | |
michael@0 | 41 | // fc2389b8-c650-4093-9e42-b05e5f0685b7 |
michael@0 | 42 | #define NS_IMAGE_TO_PIXBUF_CID \ |
michael@0 | 43 | { 0xfc2389b8, 0xc650, 0x4093, \ |
michael@0 | 44 | { 0x9e, 0x42, 0xb0, 0x5e, 0x5f, 0x06, 0x85, 0xb7 } } |
michael@0 | 45 | |
michael@0 | 46 | #endif |