widget/gtk/nsImageToPixbuf.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/gtk/nsImageToPixbuf.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +/* vim:set sw=4 sts=4 et cin: */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef NSIMAGETOPIXBUF_H_
    1.10 +#define NSIMAGETOPIXBUF_H_
    1.11 +
    1.12 +#include "nsIImageToPixbuf.h"
    1.13 +#include "mozilla/Attributes.h"
    1.14 +
    1.15 +namespace mozilla {
    1.16 +namespace gfx {
    1.17 +class SourceSurface;
    1.18 +}
    1.19 +}
    1.20 +
    1.21 +class nsImageToPixbuf MOZ_FINAL : public nsIImageToPixbuf {
    1.22 +    typedef mozilla::gfx::SourceSurface SourceSurface;
    1.23 +
    1.24 +    public:
    1.25 +        NS_DECL_ISUPPORTS
    1.26 +        NS_IMETHOD_(GdkPixbuf*) ConvertImageToPixbuf(imgIContainer* aImage);
    1.27 +
    1.28 +        // Friendlier version of ConvertImageToPixbuf for callers inside of
    1.29 +        // widget
    1.30 +        /**
    1.31 +         * The return value of all these, if not null, should be
    1.32 +         * released as needed by the caller using g_object_unref.
    1.33 +         */
    1.34 +        static GdkPixbuf* ImageToPixbuf(imgIContainer * aImage);
    1.35 +        static GdkPixbuf* SourceSurfaceToPixbuf(SourceSurface* aSurface,
    1.36 +                                                int32_t aWidth,
    1.37 +                                                int32_t aHeight);
    1.38 +
    1.39 +    private:
    1.40 +        ~nsImageToPixbuf() {}
    1.41 +};
    1.42 +
    1.43 +
    1.44 +// fc2389b8-c650-4093-9e42-b05e5f0685b7
    1.45 +#define NS_IMAGE_TO_PIXBUF_CID \
    1.46 +{ 0xfc2389b8, 0xc650, 0x4093, \
    1.47 +  { 0x9e, 0x42, 0xb0, 0x5e, 0x5f, 0x06, 0x85, 0xb7 } }
    1.48 +
    1.49 +#endif

mercurial