//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PNativeLayerRemote_h
#define PNativeLayerRemote_h

#include "mozilla/Attributes.h"
#include "IPCMessageStart.h"
#include "mozilla/RefPtr.h"
#include "nsString.h"
#include "nsTArray.h"
#include "nsTHashtable.h"
#include "mozilla/MozPromise.h"
#include "mozilla/OperatorNewExtensions.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/ipc/ByteBuf.h"
#include "mozilla/ipc/FileDescriptor.h"
#include "mozilla/ipc/IPCForwards.h"
#include "mozilla/ipc/Shmem.h"

// Headers for typedefs
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/Matrix.h"
#include "mozilla/gfx/Point.h"
#include "mozilla/ipc/IPDLStructMember.h"
#include "mozilla/layers/IOSurfacePort.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct CommandCreateLayer|
//
namespace mozilla {
namespace layers {
class CommandCreateLayer final
{
private:
    typedef ::uint64_t uint64_t;
    typedef ::mozilla::gfx::IntSize IntSize;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    CommandCreateLayer() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT CommandCreateLayer(
            const uint64_t& _ID,
            const IntSize& _Size,
            const bool& _Opaque) :
        Size_(_Size),
        Opaque_(_Opaque),
        ID_(_ID)
    {
    }

    MOZ_IMPLICIT CommandCreateLayer(
            uint64_t&& _ID,
            IntSize&& _Size,
            bool&& _Opaque) :
        Size_(std::move(_Size)),
        Opaque_(std::move(_Opaque)),
        ID_(std::move(_ID))
    {
    }

    uint64_t&
    ID()
    {
        return ID_;
    }
    const uint64_t&
    ID() const
    {
        return ID_;
    }

    IntSize&
    Size()
    {
        return Size_;
    }
    const IntSize&
    Size() const
    {
        return Size_;
    }

    bool&
    Opaque()
    {
        return Opaque_;
    }
    const bool&
    Opaque() const
    {
        return Opaque_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<IntSize> Size_;
    ::mozilla::ipc::IPDLStructMember<bool> Opaque_;
    ::mozilla::ipc::IPDLStructMember<uint64_t> ID_;
};
} // namespace layers
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::layers::CommandCreateLayer>
{
    typedef ::mozilla::layers::CommandCreateLayer paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct CommandCreateLayerForExternalTexture|
//
namespace mozilla {
namespace layers {
class CommandCreateLayerForExternalTexture final
{
private:
    typedef ::uint64_t uint64_t;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    CommandCreateLayerForExternalTexture() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT CommandCreateLayerForExternalTexture(
            const uint64_t& _ID,
            const bool& _Opaque) :
        Opaque_(_Opaque),
        ID_(_ID)
    {
    }

    MOZ_IMPLICIT CommandCreateLayerForExternalTexture(
            uint64_t&& _ID,
            bool&& _Opaque) :
        Opaque_(std::move(_Opaque)),
        ID_(std::move(_ID))
    {
    }

    uint64_t&
    ID()
    {
        return ID_;
    }
    const uint64_t&
    ID() const
    {
        return ID_;
    }

    bool&
    Opaque()
    {
        return Opaque_;
    }
    const bool&
    Opaque() const
    {
        return Opaque_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<bool> Opaque_;
    ::mozilla::ipc::IPDLStructMember<uint64_t> ID_;
};
} // namespace layers
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::layers::CommandCreateLayerForExternalTexture>
{
    typedef ::mozilla::layers::CommandCreateLayerForExternalTexture paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct CommandCreateLayerForColor|
//
namespace mozilla {
namespace layers {
class CommandCreateLayerForColor final
{
private:
    typedef ::uint64_t uint64_t;
    typedef ::mozilla::gfx::DeviceColor DeviceColor;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    CommandCreateLayerForColor() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT CommandCreateLayerForColor(
            const uint64_t& _ID,
            const DeviceColor& _Color) :
        Color_(_Color),
        ID_(_ID)
    {
    }

    MOZ_IMPLICIT CommandCreateLayerForColor(
            uint64_t&& _ID,
            DeviceColor&& _Color) :
        Color_(std::move(_Color)),
        ID_(std::move(_ID))
    {
    }

    uint64_t&
    ID()
    {
        return ID_;
    }
    const uint64_t&
    ID() const
    {
        return ID_;
    }

    DeviceColor&
    Color()
    {
        return Color_;
    }
    const DeviceColor&
    Color() const
    {
        return Color_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<DeviceColor> Color_;
    ::mozilla::ipc::IPDLStructMember<uint64_t> ID_;
};
} // namespace layers
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::layers::CommandCreateLayerForColor>
{
    typedef ::mozilla::layers::CommandCreateLayerForColor paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct CommandLayerDestroyed|
//
namespace mozilla {
namespace layers {
class CommandLayerDestroyed final
{
private:
    typedef ::uint64_t uint64_t;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    CommandLayerDestroyed() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT CommandLayerDestroyed(const uint64_t& _ID) :
        ID_(_ID)
    {
    }

    MOZ_IMPLICIT CommandLayerDestroyed(uint64_t&& _ID) :
        ID_(std::move(_ID))
    {
    }

    uint64_t&
    ID()
    {
        return ID_;
    }
    const uint64_t&
    ID() const
    {
        return ID_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<uint64_t> ID_;
};
} // namespace layers
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::layers::CommandLayerDestroyed>
{
    typedef ::mozilla::layers::CommandLayerDestroyed paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct CommandSetLayers|
//
namespace mozilla {
namespace layers {
class CommandSetLayers final
{
private:
    typedef ::uint64_t uint64_t;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    CommandSetLayers() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT CommandSetLayers(const nsTArray<uint64_t>& _IDs) :
        IDs_(_IDs)
    {
    }

    MOZ_IMPLICIT CommandSetLayers(nsTArray<uint64_t>&& _IDs) :
        IDs_(std::move(_IDs))
    {
    }

    nsTArray<uint64_t>&
    IDs()
    {
        return IDs_;
    }
    const nsTArray<uint64_t>&
    IDs() const
    {
        return IDs_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<CopyableTArray<uint64_t>> IDs_;
};
} // namespace layers
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::layers::CommandSetLayers>
{
    typedef ::mozilla::layers::CommandSetLayers paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct CommandLayerInfo|
//
namespace mozilla {
namespace layers {
class CommandLayerInfo final
{
private:
    typedef ::uint64_t uint64_t;
    typedef ::mozilla::gfx::IntPoint IntPoint;
    typedef ::mozilla::gfx::IntRect IntRect;
    typedef ::mozilla::gfx::RoundedRect RoundedRect;
    typedef ::mozilla::gfx::Matrix4x4 Matrix4x4;
    typedef ::int8_t int8_t;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    CommandLayerInfo() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT CommandLayerInfo(
            const uint64_t& _ID,
            const IntPoint& _Position,
            const IntRect& _DisplayRect,
            const mozilla::Maybe<IntRect>& _ClipRect,
            const mozilla::Maybe<RoundedRect>& _RoundedClipRect,
            const Matrix4x4& _Transform,
            const int8_t& _SamplingFilter,
            const bool& _SurfaceIsFlipped) :
        Position_(_Position),
        DisplayRect_(_DisplayRect),
        ClipRect_(_ClipRect),
        RoundedClipRect_(_RoundedClipRect),
        Transform_(_Transform),
        SurfaceIsFlipped_(_SurfaceIsFlipped),
        ID_(_ID),
        SamplingFilter_(_SamplingFilter)
    {
    }

    MOZ_IMPLICIT CommandLayerInfo(
            uint64_t&& _ID,
            IntPoint&& _Position,
            IntRect&& _DisplayRect,
            mozilla::Maybe<IntRect>&& _ClipRect,
            mozilla::Maybe<RoundedRect>&& _RoundedClipRect,
            Matrix4x4&& _Transform,
            int8_t&& _SamplingFilter,
            bool&& _SurfaceIsFlipped) :
        Position_(std::move(_Position)),
        DisplayRect_(std::move(_DisplayRect)),
        ClipRect_(std::move(_ClipRect)),
        RoundedClipRect_(std::move(_RoundedClipRect)),
        Transform_(std::move(_Transform)),
        SurfaceIsFlipped_(std::move(_SurfaceIsFlipped)),
        ID_(std::move(_ID)),
        SamplingFilter_(std::move(_SamplingFilter))
    {
    }

    uint64_t&
    ID()
    {
        return ID_;
    }
    const uint64_t&
    ID() const
    {
        return ID_;
    }

    IntPoint&
    Position()
    {
        return Position_;
    }
    const IntPoint&
    Position() const
    {
        return Position_;
    }

    IntRect&
    DisplayRect()
    {
        return DisplayRect_;
    }
    const IntRect&
    DisplayRect() const
    {
        return DisplayRect_;
    }

    mozilla::Maybe<IntRect>&
    ClipRect()
    {
        return ClipRect_;
    }
    const mozilla::Maybe<IntRect>&
    ClipRect() const
    {
        return ClipRect_;
    }

    mozilla::Maybe<RoundedRect>&
    RoundedClipRect()
    {
        return RoundedClipRect_;
    }
    const mozilla::Maybe<RoundedRect>&
    RoundedClipRect() const
    {
        return RoundedClipRect_;
    }

    Matrix4x4&
    Transform()
    {
        return Transform_;
    }
    const Matrix4x4&
    Transform() const
    {
        return Transform_;
    }

    int8_t&
    SamplingFilter()
    {
        return SamplingFilter_;
    }
    const int8_t&
    SamplingFilter() const
    {
        return SamplingFilter_;
    }

    bool&
    SurfaceIsFlipped()
    {
        return SurfaceIsFlipped_;
    }
    const bool&
    SurfaceIsFlipped() const
    {
        return SurfaceIsFlipped_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<IntPoint> Position_;
    ::mozilla::ipc::IPDLStructMember<IntRect> DisplayRect_;
    ::mozilla::ipc::IPDLStructMember<mozilla::Maybe<IntRect>> ClipRect_;
    ::mozilla::ipc::IPDLStructMember<mozilla::Maybe<RoundedRect>> RoundedClipRect_;
    ::mozilla::ipc::IPDLStructMember<Matrix4x4> Transform_;
    ::mozilla::ipc::IPDLStructMember<bool> SurfaceIsFlipped_;
    ::mozilla::ipc::IPDLStructMember<uint64_t> ID_;
    ::mozilla::ipc::IPDLStructMember<int8_t> SamplingFilter_;
};
} // namespace layers
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::layers::CommandLayerInfo>
{
    typedef ::mozilla::layers::CommandLayerInfo paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct CommandChangedSurface|
//
namespace mozilla {
namespace layers {
class CommandChangedSurface final
{
private:
    typedef ::uint64_t uint64_t;
    typedef ::mozilla::layers::IOSurfacePort IOSurfacePort;
    typedef ::mozilla::gfx::IntSize IntSize;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    CommandChangedSurface() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT CommandChangedSurface(
            const uint64_t& _ID,
            IOSurfacePort&& _Surface,
            const bool& _IsDRM,
            const bool& _IsHDR,
            const IntSize& _Size) :
        Surface_(std::move(_Surface)),
        IsDRM_(_IsDRM),
        IsHDR_(_IsHDR),
        Size_(_Size),
        ID_(_ID)
    {
    }

    MOZ_IMPLICIT CommandChangedSurface(
            uint64_t&& _ID,
            IOSurfacePort&& _Surface,
            bool&& _IsDRM,
            bool&& _IsHDR,
            IntSize&& _Size) :
        Surface_(std::move(_Surface)),
        IsDRM_(std::move(_IsDRM)),
        IsHDR_(std::move(_IsHDR)),
        Size_(std::move(_Size)),
        ID_(std::move(_ID))
    {
    }

    uint64_t&
    ID()
    {
        return ID_;
    }
    const uint64_t&
    ID() const
    {
        return ID_;
    }

    IOSurfacePort&
    Surface()
    {
        return Surface_;
    }
    const IOSurfacePort&
    Surface() const
    {
        return Surface_;
    }

    bool&
    IsDRM()
    {
        return IsDRM_;
    }
    const bool&
    IsDRM() const
    {
        return IsDRM_;
    }

    bool&
    IsHDR()
    {
        return IsHDR_;
    }
    const bool&
    IsHDR() const
    {
        return IsHDR_;
    }

    IntSize&
    Size()
    {
        return Size_;
    }
    const IntSize&
    Size() const
    {
        return Size_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<IOSurfacePort> Surface_;
    ::mozilla::ipc::IPDLStructMember<bool> IsDRM_;
    ::mozilla::ipc::IPDLStructMember<bool> IsHDR_;
    ::mozilla::ipc::IPDLStructMember<IntSize> Size_;
    ::mozilla::ipc::IPDLStructMember<uint64_t> ID_;
};
} // namespace layers
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::layers::CommandChangedSurface>
{
    typedef ::mozilla::layers::CommandChangedSurface paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            paramType&& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union NativeLayerCommand|
//
namespace mozilla {
namespace layers {
class NativeLayerCommand final
{
public:
    enum Type {
        T__None,
        TCommandCreateLayer = 1,
        TCommandCreateLayerForExternalTexture,
        TCommandCreateLayerForColor,
        TCommandLayerDestroyed,
        TCommandSetLayers,
        TCommandLayerInfo,
        TCommandChangedSurface,
        T__Last = TCommandChangedSurface
    };

private:
    typedef ::mozilla::layers::CommandCreateLayer CommandCreateLayer;
    typedef ::mozilla::layers::CommandCreateLayerForExternalTexture CommandCreateLayerForExternalTexture;
    typedef ::mozilla::layers::CommandCreateLayerForColor CommandCreateLayerForColor;
    typedef ::mozilla::layers::CommandLayerDestroyed CommandLayerDestroyed;
    typedef ::mozilla::layers::CommandSetLayers CommandSetLayers;
    typedef ::mozilla::layers::CommandLayerInfo CommandLayerInfo;
    typedef ::mozilla::layers::CommandChangedSurface CommandChangedSurface;
    typedef CommandCreateLayer CommandCreateLayer__tdef;
    typedef CommandCreateLayerForExternalTexture CommandCreateLayerForExternalTexture__tdef;
    typedef CommandCreateLayerForColor CommandCreateLayerForColor__tdef;
    typedef CommandLayerDestroyed CommandLayerDestroyed__tdef;
    typedef CommandSetLayers CommandSetLayers__tdef;
    typedef CommandLayerInfo CommandLayerInfo__tdef;
    typedef CommandChangedSurface CommandChangedSurface__tdef;

    CommandCreateLayer*
    ptr_CommandCreateLayer()
    {
        return (&(mVCommandCreateLayer));
    }
    const CommandCreateLayer*
    constptr_CommandCreateLayer() const
    {
        return (&(mVCommandCreateLayer));
    }
    CommandCreateLayerForExternalTexture*
    ptr_CommandCreateLayerForExternalTexture()
    {
        return (&(mVCommandCreateLayerForExternalTexture));
    }
    const CommandCreateLayerForExternalTexture*
    constptr_CommandCreateLayerForExternalTexture() const
    {
        return (&(mVCommandCreateLayerForExternalTexture));
    }
    CommandCreateLayerForColor*
    ptr_CommandCreateLayerForColor()
    {
        return (&(mVCommandCreateLayerForColor));
    }
    const CommandCreateLayerForColor*
    constptr_CommandCreateLayerForColor() const
    {
        return (&(mVCommandCreateLayerForColor));
    }
    CommandLayerDestroyed*
    ptr_CommandLayerDestroyed()
    {
        return (&(mVCommandLayerDestroyed));
    }
    const CommandLayerDestroyed*
    constptr_CommandLayerDestroyed() const
    {
        return (&(mVCommandLayerDestroyed));
    }
    CommandSetLayers*
    ptr_CommandSetLayers()
    {
        return (&(mVCommandSetLayers));
    }
    const CommandSetLayers*
    constptr_CommandSetLayers() const
    {
        return (&(mVCommandSetLayers));
    }
    CommandLayerInfo*
    ptr_CommandLayerInfo()
    {
        return (&(mVCommandLayerInfo));
    }
    const CommandLayerInfo*
    constptr_CommandLayerInfo() const
    {
        return (&(mVCommandLayerInfo));
    }
    CommandChangedSurface*
    ptr_CommandChangedSurface()
    {
        return (&(mVCommandChangedSurface));
    }
    const CommandChangedSurface*
    constptr_CommandChangedSurface() const
    {
        return (&(mVCommandChangedSurface));
    }

    void
    MaybeDestroy();

    void
    AssertSanity() const
    {
        MOZ_RELEASE_ASSERT((T__None) <= (mType), "invalid type tag");
        MOZ_RELEASE_ASSERT((mType) <= (T__Last), "invalid type tag");
    }
    void
    AssertSanity(Type aType) const
    {
        AssertSanity();
        MOZ_RELEASE_ASSERT((mType) == (aType), "unexpected type tag");
    }

public:
    MOZ_IMPLICIT NativeLayerCommand() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT NativeLayerCommand(const CommandCreateLayer& aOther);

    MOZ_IMPLICIT NativeLayerCommand(CommandCreateLayer&& aOther);

    MOZ_IMPLICIT NativeLayerCommand(const CommandCreateLayerForExternalTexture& aOther);

    MOZ_IMPLICIT NativeLayerCommand(CommandCreateLayerForExternalTexture&& aOther);

    MOZ_IMPLICIT NativeLayerCommand(const CommandCreateLayerForColor& aOther);

    MOZ_IMPLICIT NativeLayerCommand(CommandCreateLayerForColor&& aOther);

    MOZ_IMPLICIT NativeLayerCommand(const CommandLayerDestroyed& aOther);

    MOZ_IMPLICIT NativeLayerCommand(CommandLayerDestroyed&& aOther);

    MOZ_IMPLICIT NativeLayerCommand(const CommandSetLayers& aOther);

    MOZ_IMPLICIT NativeLayerCommand(CommandSetLayers&& aOther);

    MOZ_IMPLICIT NativeLayerCommand(const CommandLayerInfo& aOther);

    MOZ_IMPLICIT NativeLayerCommand(CommandLayerInfo&& aOther);

    MOZ_IMPLICIT NativeLayerCommand(CommandChangedSurface&& aOther);

    MOZ_IMPLICIT NativeLayerCommand(NativeLayerCommand&& aOther);

    ~NativeLayerCommand();

    Type
    type() const
    {
        return mType;
    }

    NativeLayerCommand&
    operator=(const CommandCreateLayer& aRhs);

    NativeLayerCommand&
    operator=(CommandCreateLayer&& aRhs);

    NativeLayerCommand&
    operator=(const CommandCreateLayerForExternalTexture& aRhs);

    NativeLayerCommand&
    operator=(CommandCreateLayerForExternalTexture&& aRhs);

    NativeLayerCommand&
    operator=(const CommandCreateLayerForColor& aRhs);

    NativeLayerCommand&
    operator=(CommandCreateLayerForColor&& aRhs);

    NativeLayerCommand&
    operator=(const CommandLayerDestroyed& aRhs);

    NativeLayerCommand&
    operator=(CommandLayerDestroyed&& aRhs);

    NativeLayerCommand&
    operator=(const CommandSetLayers& aRhs);

    NativeLayerCommand&
    operator=(CommandSetLayers&& aRhs);

    NativeLayerCommand&
    operator=(const CommandLayerInfo& aRhs);

    NativeLayerCommand&
    operator=(CommandLayerInfo&& aRhs);

    NativeLayerCommand&
    operator=(CommandChangedSurface&& aRhs);

    NativeLayerCommand&
    operator=(NativeLayerCommand&& aRhs);

    CommandCreateLayer&
    get_CommandCreateLayer()
    {
        AssertSanity(TCommandCreateLayer);
        return (*(ptr_CommandCreateLayer()));
    }
    const CommandCreateLayer&
    get_CommandCreateLayer() const
    {
        AssertSanity(TCommandCreateLayer);
        return (*(constptr_CommandCreateLayer()));
    }
    operator CommandCreateLayer&()
    {
        return get_CommandCreateLayer();
    }
    operator const CommandCreateLayer&() const
    {
        return get_CommandCreateLayer();
    }

    CommandCreateLayerForExternalTexture&
    get_CommandCreateLayerForExternalTexture()
    {
        AssertSanity(TCommandCreateLayerForExternalTexture);
        return (*(ptr_CommandCreateLayerForExternalTexture()));
    }
    const CommandCreateLayerForExternalTexture&
    get_CommandCreateLayerForExternalTexture() const
    {
        AssertSanity(TCommandCreateLayerForExternalTexture);
        return (*(constptr_CommandCreateLayerForExternalTexture()));
    }
    operator CommandCreateLayerForExternalTexture&()
    {
        return get_CommandCreateLayerForExternalTexture();
    }
    operator const CommandCreateLayerForExternalTexture&() const
    {
        return get_CommandCreateLayerForExternalTexture();
    }

    CommandCreateLayerForColor&
    get_CommandCreateLayerForColor()
    {
        AssertSanity(TCommandCreateLayerForColor);
        return (*(ptr_CommandCreateLayerForColor()));
    }
    const CommandCreateLayerForColor&
    get_CommandCreateLayerForColor() const
    {
        AssertSanity(TCommandCreateLayerForColor);
        return (*(constptr_CommandCreateLayerForColor()));
    }
    operator CommandCreateLayerForColor&()
    {
        return get_CommandCreateLayerForColor();
    }
    operator const CommandCreateLayerForColor&() const
    {
        return get_CommandCreateLayerForColor();
    }

    CommandLayerDestroyed&
    get_CommandLayerDestroyed()
    {
        AssertSanity(TCommandLayerDestroyed);
        return (*(ptr_CommandLayerDestroyed()));
    }
    const CommandLayerDestroyed&
    get_CommandLayerDestroyed() const
    {
        AssertSanity(TCommandLayerDestroyed);
        return (*(constptr_CommandLayerDestroyed()));
    }
    operator CommandLayerDestroyed&()
    {
        return get_CommandLayerDestroyed();
    }
    operator const CommandLayerDestroyed&() const
    {
        return get_CommandLayerDestroyed();
    }

    CommandSetLayers&
    get_CommandSetLayers()
    {
        AssertSanity(TCommandSetLayers);
        return (*(ptr_CommandSetLayers()));
    }
    const CommandSetLayers&
    get_CommandSetLayers() const
    {
        AssertSanity(TCommandSetLayers);
        return (*(constptr_CommandSetLayers()));
    }
    operator CommandSetLayers&()
    {
        return get_CommandSetLayers();
    }
    operator const CommandSetLayers&() const
    {
        return get_CommandSetLayers();
    }

    CommandLayerInfo&
    get_CommandLayerInfo()
    {
        AssertSanity(TCommandLayerInfo);
        return (*(ptr_CommandLayerInfo()));
    }
    const CommandLayerInfo&
    get_CommandLayerInfo() const
    {
        AssertSanity(TCommandLayerInfo);
        return (*(constptr_CommandLayerInfo()));
    }
    operator CommandLayerInfo&()
    {
        return get_CommandLayerInfo();
    }
    operator const CommandLayerInfo&() const
    {
        return get_CommandLayerInfo();
    }

    CommandChangedSurface&
    get_CommandChangedSurface()
    {
        AssertSanity(TCommandChangedSurface);
        return (*(ptr_CommandChangedSurface()));
    }
    const CommandChangedSurface&
    get_CommandChangedSurface() const
    {
        AssertSanity(TCommandChangedSurface);
        return (*(constptr_CommandChangedSurface()));
    }
    operator CommandChangedSurface&()
    {
        return get_CommandChangedSurface();
    }
    operator const CommandChangedSurface&() const
    {
        return get_CommandChangedSurface();
    }

private:
    union {
        CommandCreateLayer mVCommandCreateLayer;
        CommandCreateLayerForExternalTexture mVCommandCreateLayerForExternalTexture;
        CommandCreateLayerForColor mVCommandCreateLayerForColor;
        CommandLayerDestroyed mVCommandLayerDestroyed;
        CommandSetLayers mVCommandSetLayers;
        CommandLayerInfo mVCommandLayerInfo;
        CommandChangedSurface mVCommandChangedSurface;
    };
    Type mType;
};
} // namespace layers
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::layers::NativeLayerCommand>
{
    typedef ::mozilla::layers::NativeLayerCommand paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            paramType&& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC

namespace mozilla {
namespace layers {
class PNativeLayerRemoteParent;
} // namespace layers
} // namespace mozilla
namespace mozilla {
namespace layers {
class PNativeLayerRemoteChild;
} // namespace layers
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PNativeLayerRemoteChild and PNativeLayerRemoteParent
//
namespace mozilla {
namespace layers {
namespace PNativeLayerRemote {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::layers::PNativeLayerRemoteParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::layers::PNativeLayerRemoteChild>* aChild);

enum MessageType {
    PNativeLayerRemoteStart = PNativeLayerRemoteMsgStart << 16,
    Msg_CommitNativeLayerCommands__ID,
    Msg_RequestReadback__ID,
    Reply_RequestReadback__ID,
    Msg_Flush__ID,
    Reply_Flush__ID,
    PNativeLayerRemoteEnd
};

mozilla::UniquePtr<IPC::Message>
Msg_CommitNativeLayerCommands(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg_RequestReadback(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply_RequestReadback(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg_Flush(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply_Flush(IPC::Message::routeid_t routingId);



} // namespace PNativeLayerRemote
} // namespace layers
} // namespace mozilla

#endif // ifndef PNativeLayerRemote_h
