2013-06-10 13:00:35 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2014-11-13 20:03:50 -08:00
|
|
|
#ifndef WEBGL_ACTIVE_INFO_H_
|
|
|
|
#define WEBGL_ACTIVE_INFO_H_
|
2013-06-10 13:00:35 -07:00
|
|
|
|
2013-08-27 19:59:14 -07:00
|
|
|
#include "js/TypeDecls.h"
|
2014-11-13 20:03:50 -08:00
|
|
|
#include "nsString.h"
|
2015-01-13 00:07:26 -08:00
|
|
|
#include "WebGLObjectModel.h"
|
2013-06-10 13:00:35 -07:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class WebGLActiveInfo MOZ_FINAL
|
|
|
|
{
|
|
|
|
public:
|
2015-01-13 00:07:26 -08:00
|
|
|
WebGLActiveInfo(GLint size, GLenum type, const nsACString& name)
|
|
|
|
: mSize(size)
|
|
|
|
, mType(type)
|
|
|
|
, mName(NS_ConvertASCIItoUTF16(name))
|
|
|
|
{}
|
2015-01-09 21:03:54 -08:00
|
|
|
|
2015-01-12 19:51:20 -08:00
|
|
|
// WebIDL attributes
|
2015-01-13 00:07:26 -08:00
|
|
|
|
2013-09-04 05:14:43 -07:00
|
|
|
GLint Size() const {
|
2015-01-13 00:07:26 -08:00
|
|
|
return mSize;
|
2013-06-10 13:00:35 -07:00
|
|
|
}
|
|
|
|
|
2013-09-04 05:14:43 -07:00
|
|
|
GLenum Type() const {
|
2015-01-13 00:07:26 -08:00
|
|
|
return mType;
|
2013-06-10 13:00:35 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void GetName(nsString& retval) const {
|
2015-01-13 00:07:26 -08:00
|
|
|
retval = mName;
|
2013-06-10 13:00:35 -07:00
|
|
|
}
|
|
|
|
|
2015-01-08 13:56:42 -08:00
|
|
|
bool WrapObject(JSContext* aCx, JS::MutableHandle<JSObject*> aReflector);
|
2014-04-04 09:27:02 -07:00
|
|
|
|
2015-01-13 00:07:26 -08:00
|
|
|
NS_INLINE_DECL_REFCOUNTING(WebGLActiveInfo)
|
2015-01-09 21:03:54 -08:00
|
|
|
|
2015-01-13 00:07:26 -08:00
|
|
|
private:
|
2015-01-12 19:51:20 -08:00
|
|
|
// Private destructor, to discourage deletion outside of Release():
|
2015-01-13 00:07:26 -08:00
|
|
|
~WebGLActiveInfo()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
GLint mSize;
|
|
|
|
GLenum mType;
|
|
|
|
nsString mName;
|
2013-06-10 13:00:35 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2014-11-13 20:03:50 -08:00
|
|
|
#endif // WEBGL_ACTIVE_INFO_H_
|