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

#ifndef PWebGL_h
#define PWebGL_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"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union ReadPixelsBuffer|
//
namespace mozilla {
namespace dom {
class ReadPixelsBuffer final
{
public:
    enum Type {
        T__None,
        Tuint64_t = 1,
        TShmem,
        T__Last = TShmem
    };

private:
    typedef ::uint64_t uint64_t;
    typedef ::mozilla::ipc::Shmem Shmem;
    typedef uint64_t uint64_t__tdef;
    typedef Shmem Shmem__tdef;

    uint64_t*
    ptr_uint64_t()
    {
        return (&(mVuint64_t));
    }
    const uint64_t*
    constptr_uint64_t() const
    {
        return (&(mVuint64_t));
    }
    Shmem*
    ptr_Shmem()
    {
        return (&(mVShmem));
    }
    const Shmem*
    constptr_Shmem() const
    {
        return (&(mVShmem));
    }

    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 ReadPixelsBuffer() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT ReadPixelsBuffer(const uint64_t& aOther);

    MOZ_IMPLICIT ReadPixelsBuffer(uint64_t&& aOther);

    MOZ_IMPLICIT ReadPixelsBuffer(Shmem& aOther);

    MOZ_IMPLICIT ReadPixelsBuffer(Shmem&& aOther);

    MOZ_IMPLICIT ReadPixelsBuffer(const ReadPixelsBuffer& aOther);

    MOZ_IMPLICIT ReadPixelsBuffer(ReadPixelsBuffer&& aOther);

    ~ReadPixelsBuffer();

    Type
    type() const
    {
        return mType;
    }

    ReadPixelsBuffer&
    operator=(const uint64_t& aRhs);

    ReadPixelsBuffer&
    operator=(uint64_t&& aRhs);

    ReadPixelsBuffer&
    operator=(Shmem& aRhs);

    ReadPixelsBuffer&
    operator=(Shmem&& aRhs);

    ReadPixelsBuffer&
    operator=(const ReadPixelsBuffer& aRhs);

    ReadPixelsBuffer&
    operator=(ReadPixelsBuffer&& aRhs);

    uint64_t&
    get_uint64_t()
    {
        AssertSanity(Tuint64_t);
        return (*(ptr_uint64_t()));
    }
    const uint64_t&
    get_uint64_t() const
    {
        AssertSanity(Tuint64_t);
        return (*(constptr_uint64_t()));
    }
    operator uint64_t&()
    {
        return get_uint64_t();
    }
    operator const uint64_t&() const
    {
        return get_uint64_t();
    }

    Shmem&
    get_Shmem()
    {
        AssertSanity(TShmem);
        return (*(ptr_Shmem()));
    }
    Shmem&
    get_Shmem() const
    {
        AssertSanity(TShmem);
        return const_cast<Shmem&>((*(constptr_Shmem())));
    }
    operator Shmem&()
    {
        return get_Shmem();
    }
    operator Shmem&() const
    {
        return get_Shmem();
    }

private:
    union {
        uint64_t mVuint64_t;
        Shmem mVShmem;
    };
    Type mType;
};
} // namespace dom
} // namespace mozilla

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

namespace mozilla {
namespace dom {
class PWebGLParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PWebGLChild;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PWebGLChild and PWebGLParent
//
namespace mozilla {
namespace dom {
namespace PWebGL {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::dom::PWebGLParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::dom::PWebGLChild>* aChild);

enum MessageType {
    PWebGLStart = PWebGLMsgStart << 16,
    Msg_Initialize__ID,
    Reply_Initialize__ID,
    Msg___delete____ID,
    Reply___delete____ID,
    Msg_WaitForTxn__ID,
    Msg_DispatchCommands__ID,
    Msg_Ping__ID,
    Reply_Ping__ID,
    Msg_SyncPing__ID,
    Reply_SyncPing__ID,
    Msg_TexImage__ID,
    Msg_GetBufferSubData__ID,
    Reply_GetBufferSubData__ID,
    Msg_GetFrontBufferSnapshot__ID,
    Reply_GetFrontBufferSnapshot__ID,
    Msg_ReadPixels__ID,
    Reply_ReadPixels__ID,
    Msg_CheckFramebufferStatus__ID,
    Reply_CheckFramebufferStatus__ID,
    Msg_ClientWaitSync__ID,
    Reply_ClientWaitSync__ID,
    Msg_CreateOpaqueFramebuffer__ID,
    Reply_CreateOpaqueFramebuffer__ID,
    Msg_DrawingBufferSize__ID,
    Reply_DrawingBufferSize__ID,
    Msg_Finish__ID,
    Reply_Finish__ID,
    Msg_GetBufferParameter__ID,
    Reply_GetBufferParameter__ID,
    Msg_GetCompileResult__ID,
    Reply_GetCompileResult__ID,
    Msg_GetError__ID,
    Reply_GetError__ID,
    Msg_GetFragDataLocation__ID,
    Reply_GetFragDataLocation__ID,
    Msg_GetFramebufferAttachmentParameter__ID,
    Reply_GetFramebufferAttachmentParameter__ID,
    Msg_GetFrontBuffer__ID,
    Reply_GetFrontBuffer__ID,
    Msg_GetIndexedParameter__ID,
    Reply_GetIndexedParameter__ID,
    Msg_GetInternalformatParameter__ID,
    Reply_GetInternalformatParameter__ID,
    Msg_GetLinkResult__ID,
    Reply_GetLinkResult__ID,
    Msg_GetNumber__ID,
    Reply_GetNumber__ID,
    Msg_GetQueryParameter__ID,
    Reply_GetQueryParameter__ID,
    Msg_GetRenderbufferParameter__ID,
    Reply_GetRenderbufferParameter__ID,
    Msg_GetSamplerParameter__ID,
    Reply_GetSamplerParameter__ID,
    Msg_GetString__ID,
    Reply_GetString__ID,
    Msg_GetTexParameter__ID,
    Reply_GetTexParameter__ID,
    Msg_GetUniform__ID,
    Reply_GetUniform__ID,
    Msg_GetVertexAttrib__ID,
    Reply_GetVertexAttrib__ID,
    Msg_OnMemoryPressure__ID,
    Reply_OnMemoryPressure__ID,
    Msg_ValidateProgram__ID,
    Reply_ValidateProgram__ID,
    Msg_JsWarning__ID,
    Msg_OnContextLoss__ID,
    Msg_OnSyncComplete__ID,
    PWebGLEnd
};

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



} // namespace PWebGL
} // namespace dom
} // namespace mozilla

#endif // ifndef PWebGL_h
