michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef WEBGLACTIVEINFO_H_ michael@0: #define WEBGLACTIVEINFO_H_ michael@0: michael@0: #include "WebGLObjectModel.h" michael@0: #include "nsString.h" michael@0: #include "js/TypeDecls.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: class WebGLActiveInfo MOZ_FINAL michael@0: { michael@0: public: michael@0: WebGLActiveInfo(GLint size, GLenum type, const nsACString& name) : michael@0: mSize(size), michael@0: mType(type), michael@0: mName(NS_ConvertASCIItoUTF16(name)) michael@0: {} michael@0: michael@0: // WebIDL attributes michael@0: michael@0: GLint Size() const { michael@0: return mSize; michael@0: } michael@0: michael@0: GLenum Type() const { michael@0: return mType; michael@0: } michael@0: michael@0: void GetName(nsString& retval) const { michael@0: retval = mName; michael@0: } michael@0: michael@0: JSObject* WrapObject(JSContext *cx); michael@0: michael@0: NS_INLINE_DECL_REFCOUNTING(WebGLActiveInfo) michael@0: michael@0: private: michael@0: // Private destructor, to discourage deletion outside of Release(): michael@0: ~WebGLActiveInfo() michael@0: { michael@0: } michael@0: michael@0: GLint mSize; michael@0: GLenum mType; michael@0: nsString mName; michael@0: }; michael@0: michael@0: } // namespace mozilla michael@0: michael@0: #endif